Opened 7 years ago

Closed 5 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 Adam Sowa)

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 Adam Sowa, 7 years ago

Description: modified (diff)

comment:2 by Tim Graham, 7 years ago

Has patch: set
Triage Stage: UnreviewedAccepted
Type: UncategorizedNew feature

comment:3 by Tom Forbes, 7 years ago

This is similar to: https://code.djangoproject.com/ticket/27685

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?

Version 1, edited 7 years ago by Tom Forbes (previous) (next) (diff)

comment:4 by Tom Forbes, 7 years ago

Cc: Tom Forbes added

comment:5 by Tzu-ping Chung, 6 years ago

Cc: Tzu-ping Chung added

comment:6 by Tim Graham, 6 years ago

Patch needs improvement: set

comment:7 by Tom Forbes, 5 years ago

I would consider closing this now that #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.

Last edited 5 years ago by Tim Graham (previous) (diff)

comment:8 by Tim Graham, 5 years ago

Resolution: wontfix
Status: newclosed

I'm not a Windows user but that sounds reasonable to me.

Note: See TracTickets for help on using tickets.
Back to Top