You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Fauzan Ardhana (JIRA)" <ji...@apache.org> on 2018/07/31 10:36:00 UTC
[jira] [Updated] (THRIFT-4607) Go - Making concurrent connection
resulting EOF
[ https://issues.apache.org/jira/browse/THRIFT-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fauzan Ardhana updated THRIFT-4607:
-----------------------------------
Description:
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.
func (acc Account) MakeService() *ServiceClient {
httpclient, _ := thrift.NewTHttpClient(url)
trans := httpclient.(*thrift.THttpClient)
buffer := thrift.NewTBufferedTransport(trans, 2048)
trans.SetHeader("User-Agent",acc.UA)
trans.SetHeader("Authorization","Bearer "+acc.AccessToken)
compactProtocol := thrift.NewTCompactProtocol(buffer)
tclient := thrift.NewTStandardClient(compactProtocol, compactProtocol)
return NewServiceClient(tclient)
}
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.
was:
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.
{quote}func (acc Account) MakeService() *ServiceClient {
httpclient, _ := thrift.NewTHttpClient(url)
trans := httpclient.(*thrift.THttpClient)
buffer := thrift.NewTBufferedTransport(trans, 2048)
trans.SetHeader("Authorization","Bearer "+acc.AccessToken)
compactProtocol := thrift.NewTCompactProtocol(buffer)
tclient := thrift.NewTStandardClient(compactProtocol, compactProtocol)
return NewServiceClient(tclient)
}
{quote}
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.
> 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.10.0
> Reporter: Fauzan Ardhana
> Priority: Blocker
>
> 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.
> func (acc Account) MakeService() *ServiceClient {
> httpclient, _ := thrift.NewTHttpClient(url)
> trans := httpclient.(*thrift.THttpClient)
> buffer := thrift.NewTBufferedTransport(trans, 2048)
> trans.SetHeader("User-Agent",acc.UA)
> trans.SetHeader("Authorization","Bearer "+acc.AccessToken)
> compactProtocol := thrift.NewTCompactProtocol(buffer)
> tclient := thrift.NewTStandardClient(compactProtocol, compactProtocol)
> return NewServiceClient(tclient)
> }
> 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
(v7.6.3#76005)