Opened 18 months ago

Closed 2 months 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 Changed 18 months ago by Adam Sowa

Description: modified (diff)

comment:2 Changed 18 months ago by Tim Graham

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

comment:3 Changed 18 months ago by Tom Forbes

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?

Last edited 18 months ago by Tim Graham (previous) (diff)

comment:4 Changed 18 months ago by Tom Forbes

Cc: Tom Forbes added

comment:5 Changed 15 months ago by Tzu-ping Chung

Cc: Tzu-ping Chung added

comment:6 Changed 15 months ago by Tim Graham

Patch needs improvement: set

comment:7 Changed 2 months ago by Tom Forbes

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 2 months ago by Tim Graham (previous) (diff)

comment:8 Changed 2 months ago by Tim Graham

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