Opened 7 years ago
Closed 6 years ago
#28602 closed New feature (wontfix)
Filesystem watcher based autoreload implementation for Windows platform
Reported by: | Adam Sowa | Owned by: | nobody |
---|---|---|---|
Component: | Utilities | Version: | 1.11 |
Severity: | Normal | Keywords: | autoreload |
Cc: | Tom Forbes, Tzu-ping Chung | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Currently utils/autoreload.py has implementation for inotify based file system watcher. On Windows it scans all files for changes every 1 second which takes a lot of CPU. Windows provides file system watching API (FindFirstChangeNotification) which does the same thing as inotify on Linux. Django should take advantage of the API to make autoreload more efficient.
Change History (8)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → New feature |
comment:3 by , 7 years ago
This is similar to #27685 - Allow autoreloader to use watchman.
I've got a PR in that ticket (https://github.com/django/django/pull/8819) to refactor the autoreloader and add support for the Watchdog library (and watchman) over pyinotify, which handles the intricacies of Windows, Linux and Mac file system notifications. IMO, after reading the Watchdog code and seeing the rather tricky corner cases it handles (e.g this) it would be best to outsource it there than maintain our own.
Perhaps we could split #27685 into two parts, one to add support for Windows/Mac/Linux FS notifications via Watchdog (this ticket) and one to expand it to support Watchman?
comment:4 by , 7 years ago
Cc: | added |
---|
comment:5 by , 7 years ago
Cc: | added |
---|
comment:6 by , 7 years ago
Patch needs improvement: | set |
---|
comment:7 by , 6 years ago
I would consider closing this now https://code.djangoproject.com/ticket/27685 is fixed, Watchman has beta support for Windows platforms. Hopefully that will mature in the future, so it seems redundant to duplicate work on a windows-specific reloader implementation.
comment:8 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I'm not a Windows user but that sounds reasonable to me.
PR