Opened 15 years ago

Closed 12 years ago

#10725 closed Bug (fixed)

Autoreloader hides signal exits from child

Reported by: Glenn Maynard Owned by: nobody
Component: Core (Other) Version: dev
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 Maynard 15 years ago.
print signals
10725.patch (553 bytes ) - added by Aymeric Augustin 12 years ago.

Download all attachments as: .zip

Change History (7)

by Glenn Maynard, 15 years ago

Attachment: autoreload-signal.diff added

print signals

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Chris Beaven, 13 years ago

Severity: Normal
Type: Bug

comment:3 by Preston Holmes, 12 years ago

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 by Aymeric Augustin, 12 years ago

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

by Aymeric Augustin, 12 years ago

Attachment: 10725.patch added

comment:5 by Aymeric Augustin, 12 years ago

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