You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Patrick Schlangen <p....@mac.com> on 2009/05/08 12:09:33 UTC

ECONNRESET errors

Hi,

I wrote two C++ applications which are both a Thrift server and a Thrift client. Each application has a thread I create with pthread_create() before I launch the TThreadedServer. The thread basically sleeps 30 seconds, connects to the other application's Thrift server, calls a method (ReportStatus()) and then sleeps again for 30 seconds and so on.

Everything is working fine, but I get Thrift error messages on the service-side in random intervals (which are a multiple of 30 seconds, of course):

Thrift: Fri May  8 11:58:13 2009 TSocket::read() recv() <Host:  Port: 0>Connection reset by peer
Thrift: Fri May  8 11:58:13 2009 TThreadedServer client died: ECONNRESET

The messages do not seem to influence the functionality of the applications in any way. Everything is working fast and stable, all method calls are transfered properly.

What can be the cause of this error messages? One service runs on a Mac OS X 10.5.6 host, the other service runs on a CentOS server. The error messages also occur when both services run at the same (Mac OS X) host.

Any ideas?

Thanks in advance!

Patrick

Re: ECONNRESET errors

Posted by Rush Manbert <ru...@manbert.com>.
On May 8, 2009, at 9:40 AM, Rush Manbert wrote:

>
> On May 8, 2009, at 3:09 AM, Patrick Schlangen wrote:
>
>> Hi,
>>
>> I wrote two C++ applications which are both a Thrift server and a  
>> Thrift client. Each application has a thread I create with  
>> pthread_create() before I launch the TThreadedServer. The thread  
>> basically sleeps 30 seconds, connects to the other application's  
>> Thrift server, calls a method (ReportStatus()) and then sleeps  
>> again for 30 seconds and so on.
>>
>> Everything is working fine, but I get Thrift error messages on the  
>> service-side in random intervals (which are a multiple of 30  
>> seconds, of course):
>>
>> Thrift: Fri May  8 11:58:13 2009 TSocket::read() recv() <Host:   
>> Port: 0>Connection reset by peer
>> Thrift: Fri May  8 11:58:13 2009 TThreadedServer client died:  
>> ECONNRESET
>>
>> The messages do not seem to influence the functionality of the  
>> applications in any way. Everything is working fast and stable, all  
>> method calls are transfered properly.
>>
>> What can be the cause of this error messages? One service runs on a  
>> Mac OS X 10.5.6 host, the other service runs on a CentOS server.  
>> The error messages also occur when both services run at the same  
>> (Mac OS X) host.
>>
>
> Hi Patrick,
>
> I see this on Mac OS X 10.5.6 and I have been wondering if anyone  
> sees it on other systems. It sounds like your CetOS server sees it  
> too. That at least means it's not something specific to the Mac on  
> the server side.
>
> Do you know what OS your clients are running? I don't have access to  
> a Linux system here, so all of my clients are Macs. I have been  
> wondering whether the ECONNRESET error has something to do with the  
> way the Mac closes the client side socket. (Although the randomness  
> of it is hard to figure out.) So what do you know about your clients?
>
> From my reading, the server should see this error because the client  
> side reset the socket. But if you read the TSocket code there's  
> nothing like that happening. It does a shutdown of both read and  
> write, then a close.
>
> - Rush

Sorry to reply to my own post, but I re-read the original and it looks  
like you do know about your clients.

So, to clarify, do you see ECONNRESET errors when your CentOS client  
talks to your Mac server? Or do you only see it when the Mac client  
talks to either server?

I'll go drink some more coffee now.

- Rush

Re: ECONNRESET errors

Posted by Rush Manbert <ru...@manbert.com>.
On May 8, 2009, at 3:09 AM, Patrick Schlangen wrote:

> Hi,
>
> I wrote two C++ applications which are both a Thrift server and a  
> Thrift client. Each application has a thread I create with  
> pthread_create() before I launch the TThreadedServer. The thread  
> basically sleeps 30 seconds, connects to the other application's  
> Thrift server, calls a method (ReportStatus()) and then sleeps again  
> for 30 seconds and so on.
>
> Everything is working fine, but I get Thrift error messages on the  
> service-side in random intervals (which are a multiple of 30  
> seconds, of course):
>
> Thrift: Fri May  8 11:58:13 2009 TSocket::read() recv() <Host:   
> Port: 0>Connection reset by peer
> Thrift: Fri May  8 11:58:13 2009 TThreadedServer client died:  
> ECONNRESET
>
> The messages do not seem to influence the functionality of the  
> applications in any way. Everything is working fast and stable, all  
> method calls are transfered properly.
>
> What can be the cause of this error messages? One service runs on a  
> Mac OS X 10.5.6 host, the other service runs on a CentOS server. The  
> error messages also occur when both services run at the same (Mac OS  
> X) host.
>

Hi Patrick,

I see this on Mac OS X 10.5.6 and I have been wondering if anyone sees  
it on other systems. It sounds like your CetOS server sees it too.  
That at least means it's not something specific to the Mac on the  
server side.

Do you know what OS your clients are running? I don't have access to a  
Linux system here, so all of my clients are Macs. I have been  
wondering whether the ECONNRESET error has something to do with the  
way the Mac closes the client side socket. (Although the randomness of  
it is hard to figure out.) So what do you know about your clients?

 From my reading, the server should see this error because the client  
side reset the socket. But if you read the TSocket code there's  
nothing like that happening. It does a shutdown of both read and  
write, then a close.

- Rush