You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a twisted cgi resource (inside crossbar.io, in this case) with a simple script, and GETting it from a browser, cURL, etc. caused no problems. Requesting the page from an f5 load balancer "health check" caused the following traceback (not causing any consequences in this case other than polluting the crossbar log):
2018-06-11T15:27:26-0700 [Router 31860] unexpected error in processEnded
Traceback (most recent call last):
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/internet/process.py", line 64, in reapAllProcesses
process.reapProcess()
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/internet/process.py", line 350, in reapProcess
self.processEnded(status)
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/internet/_baseprocess.py", line 52, in processEnded
self.maybeCallProcessEnded()
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/internet/process.py", line 987, in maybeCallProcessEnded
_BaseProcess.maybeCallProcessEnded(self)
--- <exception caught here> ---
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/internet/_baseprocess.py", line 64, in maybeCallProcessEnded
proto.processEnded(Failure(reason))
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/web/twcgi.py", line 321, in processEnded
self.request.unregisterProducer()
File "/local1/miniconda3/envs/datacube/lib/python3.6/site-packages/twisted/web/http.py", line 913, in unregisterProducer
self.channel.unregisterProducer()
builtins.AttributeError: 'NoneType' object has no attribute 'unregisterProducer'
This can be reproduced by requesting the page like this from python:
Sleeping for some time at the end of the script fixes the problem so it seems to be down to timing, and from what I can tell Request.connectionLost (which sets the request's channel to None) is probably getting called before CGIProcessProtocol.processEnded (which calls Request.unregisterProducer that will fail when channel is None).
#!CommitTicketReference repository="" revision="78032afbc70639a2eafdc57933140eb76465f85d"
Merge pull request #1027 from chrisbarber/trunk
Author: chrisbarber
Reviewer: glyph
Fixes: ticket:9468
twisted.web.twcgi.CGIProcessProtocol.processEnded(...) now handles an already-finished request, for example when request.connectionLost(...) was called previously.
Running a twisted cgi resource (inside crossbar.io, in this case) with a simple script, and GETting it from a browser, cURL, etc. caused no problems. Requesting the page from an f5 load balancer "health check" caused the following traceback (not causing any consequences in this case other than polluting the crossbar log):
This can be reproduced by requesting the page like this from python:
Sleeping for some time at the end of the script fixes the problem so it seems to be down to timing, and from what I can tell
Request.connectionLost
(which sets the request'schannel
toNone
) is probably getting called beforeCGIProcessProtocol.processEnded
(which callsRequest.unregisterProducer
that will fail whenchannel
isNone
).Searchable metadata
The text was updated successfully, but these errors were encountered: