You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Roger Meier (JIRA)" <ji...@apache.org> on 2015/03/01 15:46:05 UTC
[jira] [Commented] (THRIFT-3002) Python loops forever with
TZlibTransport and TFileObjectTransport
[ https://issues.apache.org/jira/browse/THRIFT-3002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14342261#comment-14342261 ]
Roger Meier commented on THRIFT-3002:
-------------------------------------
do you have a test case for test/py/ to reproduce it?
> Python loops forever with TZlibTransport and TFileObjectTransport
> -----------------------------------------------------------------
>
> Key: THRIFT-3002
> URL: https://issues.apache.org/jira/browse/THRIFT-3002
> Project: Thrift
> Issue Type: Bug
> Components: Python - Library
> Affects Versions: 0.9.2
> Environment: Ubuntu Linux
> Reporter: Tom Hunt
> Labels: easyfix
> Attachments: TZlibTransport.patch
>
>
> When using a TZlibTransport wrapping a TFileObjectTransport, at end of file the TZlibTransport loops forever instead of doing anything sensible. This is because the TZlibTransport does not check for 0-length reads itself and calls TFileObjectTransport.read() rather than TFileObjectTransport.readAll() (the latter does its own checking and raises EOFError()). Thus, TZlibTransport spins forever on 0-length reads and hangs the program. Suggested fix: make TZlibTransport call readAll() instead of read() in its readComp() method, or check for 0-length reads on its own and raise EOFError().
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)