Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#21545 closed Bug (fixed)

runserver goes into an infinite loop after first request on OSX.

Reported by: loic84 Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The following snippet causes an infinite loop and its customary 100% CPU usage:

events = kqueue.control([], 1)
# After a request, reload the set of watched files.
if len(events) == 1 and events[0].ident == watcher.fileno():

This is because the event isn't currently cleared, so once the condition becomes True, it remains so indefinitely.

Change History (5)

comment:2 Changed 7 years ago by loic84

If someone with a mac would like to test that's actually doing the right thing, would help.

  1. kqueue_code_changed should print each time a reload is performed.
  2. update_watch should print after each request (handler for the request_finished signal).
  3. request_finished should print after update_watch, indicating that the signal handler did wake up the kqueue.

Most importantly, request_finished should print only once after the request, and not repeat itself indefinitely.

comment:3 Changed 7 years ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

I fail at man kqueue :(

comment:4 Changed 7 years ago by Loic Bistuer <loic.bistuer@…>

Resolution: fixed
Status: newclosed

In 9ccde8cfafda03c961343b4523ac035428c4ff25:

Fixed #21545 -- autoreload kqueue events weren't cleared which caused an infinite loop.

comment:5 Changed 7 years ago by Aymeric Augustin <aymeric.augustin@…>

In 643180b5d253e2cbc9cfccccafa5b1e35dcf5583:

Merge pull request #2016 from loic/ticket21545

Fixed #21545 -- autoreload kqueue events weren't cleared which caused an infinite loop.

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