Opened 6 years ago

Closed 3 years ago

#10725 closed Bug (fixed)

Autoreloader hides signal exits from child

Reported by: Glenn Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When the autoreloader is active, if the child (main) Python process exits with a signal, the signal is neither passed to the real parent nor displayed at all: the server silently exits. This makes interpreter crashes confusing until you realize what's going on.

Attachments (2)

autoreload-signal.diff (537 bytes) - added by Glenn 6 years ago.
print signals
10725.patch (553 bytes) - added by aaugustin 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Glenn

print signals

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by SmileyChris

  • Severity set to Normal
  • Type set to Bug

comment:3 Changed 4 years ago by ptone

  • Easy pickings unset
  • Triage Stage changed from Accepted to Ready for checkin
  • UI/UX unset

not really testable, but should provide more information to user who hits this edgecase

comment:4 Changed 3 years ago by aaugustin

I'm uploading a new patch that passes the signal to the parent. Thus, the shell can display something useful — for instance with bash:

Shell 1:

$ PYTHONPATH=../django-trunk ./manage.py runserver                                                              
Validating models...

0 errors found
Django version 1.4 alpha 1 SVN-17289, using settings 'tz_demo.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Shell 2:

$ pstree | grep Python                                                                                                                                                                                                     ~
 | | |     \-+= 37217 myk /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./manage.py runserver
 | | |       \--- 37218 myk /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./manage.py runserver
 | |     \--- 37220 myk grep Python
$ kill 37218    # kills the child

Shell 1:

Terminated: 15

Changed 3 years ago by aaugustin

comment:5 Changed 3 years ago by aaugustin

  • Resolution set to fixed
  • Status changed from new to closed

In [17296]:

Fixed #10725 -- When the child process spawned by the autoreloader gets killed by a signal, passed the signal to the parent, in order to make debugging easier.

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