[
https://issues.apache.org/jira/browse/THRIFT-4600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17158901#comment-17158901
]
Alagappan Maruthappan commented on THRIFT-4600:
-----------------------------------------------
The patch failed since it doesn't clear the response which leads to
ResponseNotReady errors and invalid buffer state. As per http client lib
suggestion ([https://docs.python.org/3/library/http.client.html]) the previous
response should be read and cleared before making next call. Added a block to
read and clear the response while flushing.
New PR for this issue: [https://github.com/apache/thrift/pull/2204]
> Don't close the connection in flush for python THttpClient.py
> -------------------------------------------------------------
>
> Key: THRIFT-4600
> URL: https://issues.apache.org/jira/browse/THRIFT-4600
> Project: Thrift
> Issue Type: Bug
> Components: Python - Library
> Affects Versions: 0.11.0
> Reporter: Finn Isaac Norris Colman
> Priority: Major
> Attachments: 1572.patch
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> In thrift/lib/py/src/transport/THttpClient.py in the flush method it closes
> and reopens the connection:
> {noformat}
> if self.isOpen():
> self.close()
> self.open(){noformat}
>
> This code is closing the connection on every flush request. The flush request
> occurs for every message send, which means that keep alive cannot be used.
> Removing this code from flush means that keep alive can be used as the user
> now has control over when the connection is closed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)