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
Below is a minimal example. Large file uploads are failing on TLS servers while smaller file uploads work as expected. This could be a duplicate of #185, but I'm seeing a different stack trace. (Originally from vanvalenlab/kiosk-client#59)
Unhandled Error
Traceback (most recent call last):
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/python/log.py", line 103, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/python/log.py", line 86, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/python/context.py", line 122, in callWithContext
returnself.currentContext().callWithContext(ctx, func, *args, **kw)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/python/context.py", line 85, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/selectreactor.py", line 149, in _doReadOrWrite
why = getattr(selectable, method)()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/tcp.py", line 243, in doRead
return self._dataReceived(data)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/tcp.py", line 249, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/endpoints.py", line 132, in dataReceived
return self._wrappedProtocol.dataReceived(data)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/protocols/tls.py", line 325, in dataReceived
self._unbufferPendingWrites()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/protocols/tls.py", line 498, in _unbufferPendingWrites
self._producer.resumeProducing()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/protocols/tls.py", line 101, in resumeProducing
self._producer.resumeProducing()
File "/Users/willgraf/env/lib/python3.7/site-packages/treq/multipart.py", line 117, in resumeProducing
self._currentProducer.resumeProducing()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/web/client.py", line 1217, in resumeProducing
self._task.resume()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/task.py", line 460, in resume
raise NotPaused()
twisted.internet.task.NotPaused:
Unexpected exception from treq.multipart.MultiPartProducer.stopProducing
Traceback (most recent call last):
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/protocols/policies.py", line 125, in connectionLost
self.wrappedProtocol.connectionLost(reason)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/web/_newclient.py", line 1050, in dispatcher
return func(*args, **kwargs)
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/web/_newclient.py", line 1734, in _connectionLost_TRANSMITTING
self._currentRequest.stopWriting()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/web/_newclient.py", line 951, in stopWriting
_callAppFunction(self.bodyProducer.stopProducing)
--- <exception caught here> ---
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/web/_newclient.py", line 197, in _callAppFunction
function()
File "/Users/willgraf/env/lib/python3.7/site-packages/treq/multipart.py", line 91, in stopProducing
self._currentProducer.stopProducing()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/web/client.py", line 1161, in stopProducing
self._task.stop()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/task.py", line 497, in stop
self._checkFinish()
File "/Users/willgraf/env/lib/python3.7/site-packages/twisted/internet/task.py", line 507, in _checkFinish
raise self._completionState
twisted.internet.task.TaskStopped:
I spent a bit of time poking at this tonight. I'm not too familiar with this part of treq, but I am pretty sure that there is a reentrancy issue in MultipartProducer. There are a number of places where it does multiple writes to the consumer without checking if it has been paused. I've no doubt that this is a bug in treq, but I'll need to spend some more time on this before I'm confident in my diagnosis or how to fix it.
To be clear, I'm not sure when I'll get back to this. If you need a fix for this urgently I suggest that you take a crack at it yourself.
Below is a minimal example. Large file uploads are failing on TLS servers while smaller file uploads work as expected. This could be a duplicate of #185, but I'm seeing a different stack trace. (Originally from vanvalenlab/kiosk-client#59)
The stack trace:
My environment:
The text was updated successfully, but these errors were encountered: