Opened 10 years ago

Closed 7 years ago

#10725 closed Bug (fixed)

Autoreloader hides signal exits from child

Reported by: Glenn Maynard 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


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 Maynard 10 years ago.
print signals
10725.patch (553 bytes) - added by Aymeric Augustin 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by Glenn Maynard

Attachment: autoreload-signal.diff added

print signals

comment:1 Changed 9 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Chris Beaven

Severity: Normal
Type: Bug

comment:3 Changed 7 years ago by Preston Holmes

Easy pickings: unset
Triage Stage: AcceptedReady for checkin
UI/UX: unset

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

comment:4 Changed 7 years ago by Aymeric Augustin

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 ./ runserver                                                              
Validating models...

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

Shell 2:

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

Shell 1:

Terminated: 15

Changed 7 years ago by Aymeric Augustin

Attachment: 10725.patch added

comment:5 Changed 7 years ago by Aymeric Augustin

Resolution: fixed
Status: newclosed

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