[Django] #22991: Development server reloading

17 views
Skip to first unread message

Django

unread,
Jul 10, 2014, 9:25:41 AM7/10/14
to django-...@googlegroups.com
#22991: Development server reloading
--------------------------------------------+----------------------
Reporter: lorinkoz@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Core (Management commands) | Version: 1.7-rc-1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------------+----------------------
I'm on Windows, not sure when this started to happen but the development
server is not restarting/reloading anymore when I change code in
models.py. I'm not using pynotify.

--
Ticket URL: <https://code.djangoproject.com/ticket/22991>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 13, 2014, 7:41:36 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading on Windows
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* cc: anubhav9042@… (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => Bug


Comment:

Anubhav, can you reproduce this? If so, could you bisect the regression?

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:1>

Django

unread,
Jul 13, 2014, 7:42:59 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading on Windows
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

#23020 reports the same issue on Mac OS X, but I have no problems on
Linux.

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:2>

Django

unread,
Jul 13, 2014, 8:42:24 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading on Windows
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by CollinAnderson):

I can confirm it doesn't work and bisected it to
1bb8ccdb9e70bee35759f2ada4d661481852ab95 (Fixed pyinotify performance
regression)

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:3>

Django

unread,
Jul 13, 2014, 8:49:34 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading on Windows
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:4>

Django

unread,
Jul 13, 2014, 9:09:33 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by CollinAnderson):

Ok, I can reproduce it on `Ubuntu 12.04` by uninstalling `python-inotify`
(`pyinotify`) and turning off `sys.dont_write_bytecode`
(`PYTHONDONTWRITEBYTECODE`). It's happening on all platforms, so I'll mark
#23020 as a duplicate.

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:5>

Django

unread,
Jul 13, 2014, 10:02:13 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by CollinAnderson):

* needs_tests: 0 => 1


Comment:

*.pyc filenames are ending up in `_cached_filenames`, and then being
returned from the cache without being converted from `.pyc` to `.py`. This
change caches the `*.py` filenames instead.
https://github.com/django/django/pull/2913

I also noticed an inconsistency with `_error_files`. It's not clear if or
when those should be added to _cached_filenames and if and when inotify
needs to start watching them.

I would appreciate someone else writing a test case.

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:6>

Django

unread,
Jul 13, 2014, 10:17:22 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0

Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by CollinAnderson):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:7>

Django

unread,
Jul 13, 2014, 10:17:42 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by CollinAnderson):

* cc: cmawebsite@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:8>

Django

unread,
Jul 13, 2014, 10:31:49 PM7/13/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by CollinAnderson):

`_error_files` handles cases from #9589 and #8413. I bet those have also
regressed.

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:9>

Django

unread,
Jul 14, 2014, 1:44:37 AM7/14/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by melinath):

* cc: melinath (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:10>

Django

unread,
Jul 14, 2014, 10:54:57 AM7/14/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by CollinAnderson):

I actually can't reproduce any `_error_files` issues. It seems that
nowadays, either the check framework fully stops the process on
`models.py` and `admin.py` errors before the autoreloader starts (would be
nice to fix someday), or in other files, like `views.py`, it can handle
re-importing the bad files without needing to reload.

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:11>

Django

unread,
Jul 14, 2014, 3:50:00 PM7/14/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: new
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution:
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by claudep):

* needs_tests: 1 => 0


Comment:

I've slightly adapted the PR from Collin and added a one-line test in
https://github.com/django/django/pull/2918

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:12>

Django

unread,
Jul 15, 2014, 3:59:16 AM7/15/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody
Type: Bug | Status: closed

Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution: fixed

Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"4e424084e6d796f7ed5f215330cd0b98287c1300"]:
{{{
#!CommitTicketReference repository=""
revision="4e424084e6d796f7ed5f215330cd0b98287c1300"
Fixed #22991 -- Prevented *.pyc files in autoreload monitoring

This fixes a regression introduced in 6d302f639.
Thanks lorinkoz at gmail.com for the report, Collin Anderson
for the initial patch and Simon Charette for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:13>

Django

unread,
Jul 15, 2014, 4:00:17 AM7/15/14
to django-...@googlegroups.com
#22991: Development server not reloading with *.pyc files and without inotify
-------------------------------------+-------------------------------------
Reporter: lorinkoz@… | Owner: nobody

Type: Bug | Status: closed
Component: Core (Management | Version: 1.7-rc-1
commands) | Resolution: fixed
Severity: Release blocker | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Claude Paroz <claude@…>):

In [changeset:"f2011e21a2d803ab6328852c3af4a4bf6701b11d"]:
{{{
#!CommitTicketReference repository=""
revision="f2011e21a2d803ab6328852c3af4a4bf6701b11d"
[1.7.x] Fixed #22991 -- Prevented *.pyc files in autoreload monitoring

This fixes a regression introduced in 6d302f639.
Thanks lorinkoz at gmail.com for the report, Collin Anderson
for the initial patch and Simon Charette for the review.

Backport of 4e424084e from master.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22991#comment:14>

Reply all
Reply to author
Forward
0 new messages