#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: | dev |
| 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 |
Description
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(): continue
This is because the event isn't currently cleared, so once the condition becomes True, it remains so indefinitely.
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
If someone with a mac would like to test that's actually doing the right thing, https://gist.github.com/7752939 would help.
kqueue_code_changedshould print each time a reload is performed.update_watchshould print after each request (handler for therequest_finishedsignal).request_finishedshould print afterupdate_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:4 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
PR https://github.com/django/django/pull/2016.