You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by King JKing <be...@gmail.com> on 2011/02/27 19:36:09 UTC

Thrift THsHaServer - connection timeout???

Dear all,

My service use Thrift050, THsHaServer, and based on Java.
Here is my server code:
        QueueServer server = new QueueServer();
        QueueService.Processor processor = new QueueService.Processor(
                server);
        TNonblockingServerSocket socket = new TNonblockingServerSocket(
                listenPort);
        THsHaServer.Options options = new THsHaServer.Options();
        TServer serverEngine = new THsHaServer(processor, socket, options);

Here is my client code:
        TTransport socket = new TSocket(host, port);
        TTransport transport = new TFramedTransport(socket);
        TProtocol protocol = new TBinaryProtocol(transport);
        transport.open();

My system run rather well in 6 month ago. But two weeks ago,  my system run
bad. Sometime my service hang up (timeout exception always throw when
connect to my service)

I've checked my system log. The request to my system equals to six months
ago. CPU and RAM still good. No code change.

Anybody have the same problem with me?
Could you give me the way to fix this?

I know if the service use TThreadPoolServer, when you telnet to this and
type something, the service will stop with exception OOM. Maybe the same
problem when use THsHaServer?

Thank a lot for support.
Best regards.

Re: Thrift THsHaServer - connection timeout???

Posted by Niraj Tolia <nt...@maginatics.com>.
On Sun, Feb 27, 2011 at 2:43 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> I thought that was fixed in https://issues.apache.org/jira/browse/THRIFT-601
>

Yes, but unless QueueServer/Service does something special, the below
code doesn't set either maxReadBufferBytes for the server args or
maxLength for the TFramedTransport.Factory.

Therefore, I suspect the server will crash.

Cheers,
Niraj

> On Sun, Feb 27, 2011 at 1:43 PM, Bryan Duxbury <br...@rapleaf.com> wrote:
>> If you telnet into a THsHaServer, you are extremely likely to crash the
>> server, so don't do that.
>>
>> On Sun, Feb 27, 2011 at 10:36 AM, King JKing <be...@gmail.com> wrote:
>>
>>> Dear all,
>>>
>>> My service use Thrift050, THsHaServer, and based on Java.
>>> Here is my server code:
>>>        QueueServer server = new QueueServer();
>>>        QueueService.Processor processor = new QueueService.Processor(
>>>                server);
>>>        TNonblockingServerSocket socket = new TNonblockingServerSocket(
>>>                listenPort);
>>>        THsHaServer.Options options = new THsHaServer.Options();
>>>        TServer serverEngine = new THsHaServer(processor, socket, options);
>>>
>>> Here is my client code:
>>>        TTransport socket = new TSocket(host, port);
>>>        TTransport transport = new TFramedTransport(socket);
>>>        TProtocol protocol = new TBinaryProtocol(transport);
>>>        transport.open();
>>>
>>> My system run rather well in 6 month ago. But two weeks ago,  my system run
>>> bad. Sometime my service hang up (timeout exception always throw when
>>> connect to my service)
>>>
>>> I've checked my system log. The request to my system equals to six months
>>> ago. CPU and RAM still good. No code change.
>>>
>>> Anybody have the same problem with me?
>>> Could you give me the way to fix this?
>>>
>>> I know if the service use TThreadPoolServer, when you telnet to this and
>>> type something, the service will stop with exception OOM. Maybe the same
>>> problem when use THsHaServer?
>>>
>>> Thank a lot for support.
>>> Best regards.
>>>
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com
>

Re: Thrift THsHaServer - connection timeout???

Posted by Jonathan Ellis <jb...@gmail.com>.
I thought that was fixed in https://issues.apache.org/jira/browse/THRIFT-601

On Sun, Feb 27, 2011 at 1:43 PM, Bryan Duxbury <br...@rapleaf.com> wrote:
> If you telnet into a THsHaServer, you are extremely likely to crash the
> server, so don't do that.
>
> On Sun, Feb 27, 2011 at 10:36 AM, King JKing <be...@gmail.com> wrote:
>
>> Dear all,
>>
>> My service use Thrift050, THsHaServer, and based on Java.
>> Here is my server code:
>>        QueueServer server = new QueueServer();
>>        QueueService.Processor processor = new QueueService.Processor(
>>                server);
>>        TNonblockingServerSocket socket = new TNonblockingServerSocket(
>>                listenPort);
>>        THsHaServer.Options options = new THsHaServer.Options();
>>        TServer serverEngine = new THsHaServer(processor, socket, options);
>>
>> Here is my client code:
>>        TTransport socket = new TSocket(host, port);
>>        TTransport transport = new TFramedTransport(socket);
>>        TProtocol protocol = new TBinaryProtocol(transport);
>>        transport.open();
>>
>> My system run rather well in 6 month ago. But two weeks ago,  my system run
>> bad. Sometime my service hang up (timeout exception always throw when
>> connect to my service)
>>
>> I've checked my system log. The request to my system equals to six months
>> ago. CPU and RAM still good. No code change.
>>
>> Anybody have the same problem with me?
>> Could you give me the way to fix this?
>>
>> I know if the service use TThreadPoolServer, when you telnet to this and
>> type something, the service will stop with exception OOM. Maybe the same
>> problem when use THsHaServer?
>>
>> Thank a lot for support.
>> Best regards.
>>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: Thrift THsHaServer - connection timeout???

Posted by Bryan Duxbury <br...@rapleaf.com>.
If you telnet into a THsHaServer, you are extremely likely to crash the
server, so don't do that.

On Sun, Feb 27, 2011 at 10:36 AM, King JKing <be...@gmail.com> wrote:

> Dear all,
>
> My service use Thrift050, THsHaServer, and based on Java.
> Here is my server code:
>        QueueServer server = new QueueServer();
>        QueueService.Processor processor = new QueueService.Processor(
>                server);
>        TNonblockingServerSocket socket = new TNonblockingServerSocket(
>                listenPort);
>        THsHaServer.Options options = new THsHaServer.Options();
>        TServer serverEngine = new THsHaServer(processor, socket, options);
>
> Here is my client code:
>        TTransport socket = new TSocket(host, port);
>        TTransport transport = new TFramedTransport(socket);
>        TProtocol protocol = new TBinaryProtocol(transport);
>        transport.open();
>
> My system run rather well in 6 month ago. But two weeks ago,  my system run
> bad. Sometime my service hang up (timeout exception always throw when
> connect to my service)
>
> I've checked my system log. The request to my system equals to six months
> ago. CPU and RAM still good. No code change.
>
> Anybody have the same problem with me?
> Could you give me the way to fix this?
>
> I know if the service use TThreadPoolServer, when you telnet to this and
> type something, the service will stop with exception OOM. Maybe the same
> problem when use THsHaServer?
>
> Thank a lot for support.
> Best regards.
>