Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I'm running a recent snapshot and observed the following problem when sending a message from Python: when an error is thrown after _oprot.writeMessageBegin and before _oprot.trans.flush, the data that has already been written remains in the transport's buffer. This seems to cause a deadlock in my case.
The generated code currently looks like this:
self._oprot.writeMessageBegin(...) # snip args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush()
Shouldn't it look like this?:
try:
self._oprot.writeMessageBegin(...)
# snip
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
except:
self._oprot.trans.reset()
raise
Where trans.reset() would clear the output buffer, for example in TBufferedTransport do "self.__wbuf = StringIO()".
Am I missing something?
Attachments
Issue Links
- is related to
-
THRIFT-834 THttpClient resends contents of message after transport errors
- Closed
-
THRIFT-4564 TBufferedTransport can leave corrupt data in the buffer
- Closed