#32534: Allow using StatReloader even if watchman is available
-------------------------------------------+------------------------
               Reporter:  Evgeny Arshinov  |          Owner:  nobody
                   Type:  New feature      |         Status:  new
              Component:  Utilities        |        Version:  dev
               Severity:  Normal           |       Keywords:  reload
           Triage Stage:  Unreviewed       |      Has patch:  0
    Needs documentation:  0                |    Needs tests:  0
Patch needs improvement:  0                |  Easy pickings:  0
                  UI/UX:  0                |
-------------------------------------------+------------------------
 Hi,

 Currently if Django discovers a compatible version of `watchman`, it
 unconditionally used WatchmanReloader instead of StatReloader. There is
 reason to do that because normally WatchmanReloader performs just as
 reliably as StatReloader while being more efficient. However, in my setup,
 which is WSL 2 + Docker with project dir mounted from Windows filesystem,
 watchman simply doesn't work because of non-functioning inotify. This lack
 of inotify support on WSL's part isn't clearly documented, but there are
 two issues WSL project members usually reference:
 - https://github.com/microsoft/WSL/issues/4064
 - https://github.com/microsoft/WSL/issues/4739

 WSL people strongly recommend placing files to be mounted into Docker on
 the WSL filesystem (rather than Windows filesystem), but I have to keep
 them in Windows filesystem due to other issues in my development
 infrastructure. Not all of our development team members have to do that,
 so I can't exclude watchman from our development Docker image altogether
 which would ruin the autoreload experience for others.

 What I suggest is an environment variable like `DJANGO_WATCHMAN_ENABLE(D)`
 / `DJANGO_WATCHMAN_DISABLE(D)` which would allow me to turn off watchman
 support without altering the Docker image.

 References:
 - Watchman support in django.utils.autoreload:
 https://code.djangoproject.com/ticket/27685
 - [https://docs.djangoproject.com/en/3.1/ref/django-admin/#envvar-
 DJANGO_WATCHMAN_TIMEOUT DJANGO_WATCHMAN_TIMEOUT] - an existing watchman
 configuration option to be defined as an env var

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.ada9d13dff86572878a224df2e571f98%40djangoproject.com.

Reply via email to