[ 
https://issues.apache.org/jira/browse/THRIFT-4888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16874820#comment-16874820
 ] 

Vladimir Nevzorov edited comment on THRIFT-4888 at 6/28/19 10:02 AM:
---------------------------------------------------------------------

I [ignored SIGPIPE|https://stackoverflow.com/a/108192/6564069]
{code:java}
signal(SIGPIPE, SIG_IGN);{code}
and my server no longer crashes when connections close!

 

But instead of crash now it complains:
{noformat}
Thrift: Fri Jun 28 12:58:11 2019 SSL_shutdown: Broken pipe{noformat}


was (Author: avovana):
I [ignored SIGPIPE|https://stackoverflow.com/a/108192/6564069]
{code:java}
signal(SIGPIPE, SIG_IGN);{code}
and my server no longer crash!

 

But instead of crashing when connection closed now it complains:
{noformat}
Thrift: Fri Jun 28 12:58:11 2019 SSL_shutdown: Broken pipe{noformat}

> TSSLSocket::close() server crash
> --------------------------------
>
>                 Key: THRIFT-4888
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4888
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.10.0
>            Reporter: Vladimir Nevzorov
>            Priority: Major
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> *Client* gets info from the server and terminates succesfully.
> But *Server* crashes when *client* _TBufferedTransport_ calls close().
>  
> Client code:
> {code:java}
> int main() {
>     std::cout << "C++ client in network mode start..." << std::endl;
>     shared_ptr<AllowAllAccessManager> acc_mgr(new AllowAllAccessManager());
>     shared_ptr<apache::thrift::transport::TSSLSocketFactory> 
> ssl_tx_transp_factory(
>         new qkd_api_client::SSLSocketTransportFactory(CLIENT_TX_CERT_PATH,
>                                       CLIENT_TX_KEY_PATH,
>                                       TRUSTED_CA_PATH,
>                                       acc_mgr)
>     );
>     shared_ptr<TBufferedTransport> transp_tx(
>             new 
> TBufferedTransport(ssl_tx_transp_factory->createSocket(TX_SERVER_ADDR, 
> SERVER_PORT)));
>     auto client_tx = 
> qkd_network_api::v1::NetworkApiServiceClient(boost::shared_ptr<TProtocol>(new 
> TBinaryProtocol(transp_tx)));
>     try {
>         transp_tx->open();
>         qkd_network_api::v1::Info info_tx;
>         client_tx.get_by_length(info_tx, 22, 33);
>         transp_tx->close()
> ...
> {code}
>  
> Server output:
> {code:java}
> write 0x00007f2a0992c1cd
> <unknown> 0x00007f2a07d65d05
> BIO_write 0x00007f2a07d607cb
> <unknown> 0x00007f2a08165c9b
> <unknown> 0x00007f2a081664d0
> <unknown> 0x00007f2a0816e9b1
> <unknown> 0x00007f2a0816ce05
> SSL_shutdown 0x00007f2a081770c9
> apache::thrift::transport::TSSLSocket::close 0x00007f2a0842aa51
> apache::thrift::server::TConnectedClient::cleanup 0x00007f2a08433196
> apache::thrift::server::TConnectedClient::run 0x00007f2a08432d65
> apache::thrift::server::TThreadedServer::TConnectedClientRunner::run 
> 0x00007f2a0843a5f8
> apache::thrift::concurrency::PthreadThread::threadMain 0x00007f2a0843e5ff
> start_thread 0x00007f2a099234a4
> clone 0x00007f2a051e2d0f
> {code}
>  
> If client open() and close() transport without calling interface method - 
> server works fine.
>  
> {code:c++}
>         ...
>         transp_tx->open();
>         // client_tx.get_by_length(info_tx, 22, 33);
>         transp_tx->close()
>         ...
> {code}
> When I use python client - all works fine.
>  
> Help me, please.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to