Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#4953 closed (duplicate)

Starting a subprocess causes incomplete requests in dev server

Reported by: John Shaffer <jshaffer2112@…> Owned by: nobody
Component: django-admin.py runserver Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you open a subprocess in your view, the request will not be completely sent to the browser. Using subprocess.Popen(process, close_fds=True) will bypass this problem, but close_fds is unimplemented on Windows.

With the following view, the redirect is never received if using the dev server. The dev server will still be active and will continue to serve requests, but any requests to the hang view will not complete. When using mod_python, the redirect will work.

import subprocess
from django import http

def hang(request):
    proc = subprocess.Popen('python')
    return http.HttpResponseRedirect('/')

#3712 might be related.

Change History (4)

comment:1 by Ramiro Morales, 17 years ago

IMVHO, having to cope with this kind of specific scenario is very well outside of the scope of the development server. If the mod_python setup works then it may be better to set up a apache+mod_python developent environment.

in reply to:  1 comment:2 by John Shaffer <jshaffer2112@…>, 17 years ago

Component: Uncategorizeddjango-admin.py runserver
Owner: changed from Jacob to Adrian Holovaty

Replying to Ramiro Morales:

IMVHO, having to cope with this kind of specific scenario is very well outside of the scope of the development server. If the mod_python setup works then it may be better to set up a apache+mod_python developent environment.

It really depends on the nature of the fix. If it involves many changes, then it probably is not worth applying. But if it's a small change, then there is likely no reason not to apply it.

I'll post again when I have time to try to narrow down the cause, and if I'm able to produce a fix.

comment:3 by Philippe Raoult, 17 years ago

Resolution: duplicate
Status: newclosed

dup of #3712 which is invalid.

comment:4 by anonymous, 15 years ago

This doesn't seem to be a dup of #3712 or #9286.
Those call p.communicate() once the process is created this one does not.

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