[ 
https://issues.apache.org/jira/browse/THRIFT-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sylwester Lachiewicz resolved THRIFT-4607.
------------------------------------------
    Resolution: Not A Bug

A Thrift client and the transport under it are not safe for concurrent use: the 
standard client keeps one sequence id and one connection, so two goroutines 
calling through the same client interleave their requests on the wire and the 
second reader sees EOF or an out-of-sequence response. The snippet in the 
report shares one client across goroutines. Use one client per goroutine, or a 
pool such as the one proposed in THRIFT-6207. Resolving as not a bug; a 
sentence saying this belongs in lib/go/README.md and can go in with that ticket.

_This comment was created with AI assistance._

> Go - Making concurrent connection resulting EOF
> -----------------------------------------------
>
>                 Key: THRIFT-4607
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4607
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Library
>    Affects Versions: 0.11.0
>            Reporter: Fauzan Ardhana
>            Priority: Major
>
> When i make concurrent function calls thrift returns error, but when i tried 
> to modified the code to use closed connection it runs fine. I need to use 
> keep-alive connection to make the request efficiently.
> snippet of my code : https://ghostbin.com/paste/ts3oo
> i don't know what went wrong with my code but, the EOF happens when i tried 
> to make 2 services(different headers) and run them concurrently while using 
> keep-alive connection, it is fine when i only use one service.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to