You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Jens Geyer <je...@hotmail.com> on 2010/10/17 21:03:36 UTC

TFileTransport.cpp readTimeout_

In TFileTransport::readEvent()  the readTimeout_ is used this way:

    usleep(readTimeout_ * 1000);

However, there is an constant near the declaration of readTimeout_ which 
says

  int32_t readTimeout_;
  static const int32_t DEFAULT_READ_TIMEOUT_MS = 200;

Thus applying the default value could cause a wait of 200 seconds, IMHO.

Correct?

JensG

 


Re: TFileTransport.cpp readTimeout_

Posted by Jens Geyer <je...@hotmail.com>.
>> I think it's right to multiply by 1000 because usleep(t) sleeps for t 
>> microseconds
>> not miliseconds. Right?
> This is correct, usleep is in microseconds.

Agree. Should have read twice.


> As an aside, we don't actually use this constant anymore and should 
> probably remove it.

Ok, thanks, good to know.


JensG


--------------------------------------------------
From: "Mark Slee" <ms...@facebook.com>
Sent: Monday, October 18, 2010 8:57 PM
To: <th...@incubator.apache.org>
Subject: RE: TFileTransport.cpp  readTimeout_

> This is correct, usleep is in microseconds.
>
> As an aside, we don't actually use this constant anymore and should 
> probably remove it.
>
> mcslee@dev110 ~/local/thrift-apache/trunk/lib/cpp/src $grep -r 
> DEFAULT_READ_TIMEOUT *
> transport/.svn/text-base/TFileTransport.h.svn-base:  static const int32_t 
> DEFAULT_READ_TIMEOUT_MS = 200;
> transport/TFileTransport.h:  static const int32_t DEFAULT_READ_TIMEOUT_MS 
> = 200;
>
> No other appearances of this constant that I can find...
>
> We now initialize readTimeout_ as follows:
>  , readTimeout_(NO_TAIL_READ_TIMEOUT)
>
> Cheers,
> mcslee
>
>
> -----Original Message-----
> From: Igor Ribeiro de Assis [mailto:igor.assis@gmail.com]
> Sent: Sunday, October 17, 2010 6:13 PM
> To: thrift-dev@incubator.apache.org
> Subject: Re: TFileTransport.cpp readTimeout_
>
> I think it's right to multiply by 1000 because usleep(t) sleeps for t 
> microseconds not miliseconds. Right?
>
> Igor
>
> On Oct 17, 2010, at 12:03 PM, Jens Geyer wrote:
>
>> In TFileTransport::readEvent()  the readTimeout_ is used this way:
>>
>>   usleep(readTimeout_ * 1000);
>>
>> However, there is an constant near the declaration of readTimeout_ which 
>> says
>>
>> int32_t readTimeout_;
>> static const int32_t DEFAULT_READ_TIMEOUT_MS = 200;
>>
>> Thus applying the default value could cause a wait of 200 seconds, IMHO.
>>
>> Correct?
>>
>> JensG
>>
>>
>
> 

RE: TFileTransport.cpp readTimeout_

Posted by Mark Slee <ms...@facebook.com>.
This is correct, usleep is in microseconds.

As an aside, we don't actually use this constant anymore and should probably remove it.

mcslee@dev110 ~/local/thrift-apache/trunk/lib/cpp/src $grep -r DEFAULT_READ_TIMEOUT *
transport/.svn/text-base/TFileTransport.h.svn-base:  static const int32_t DEFAULT_READ_TIMEOUT_MS = 200;
transport/TFileTransport.h:  static const int32_t DEFAULT_READ_TIMEOUT_MS = 200;

No other appearances of this constant that I can find...

We now initialize readTimeout_ as follows:
  , readTimeout_(NO_TAIL_READ_TIMEOUT)

Cheers,
mcslee


-----Original Message-----
From: Igor Ribeiro de Assis [mailto:igor.assis@gmail.com] 
Sent: Sunday, October 17, 2010 6:13 PM
To: thrift-dev@incubator.apache.org
Subject: Re: TFileTransport.cpp readTimeout_

I think it's right to multiply by 1000 because usleep(t) sleeps for t microseconds not miliseconds. Right?

Igor

On Oct 17, 2010, at 12:03 PM, Jens Geyer wrote:

> In TFileTransport::readEvent()  the readTimeout_ is used this way:
> 
>   usleep(readTimeout_ * 1000);
> 
> However, there is an constant near the declaration of readTimeout_ which says
> 
> int32_t readTimeout_;
> static const int32_t DEFAULT_READ_TIMEOUT_MS = 200;
> 
> Thus applying the default value could cause a wait of 200 seconds, IMHO.
> 
> Correct?
> 
> JensG
> 
> 


Re: TFileTransport.cpp readTimeout_

Posted by Igor Ribeiro de Assis <ig...@gmail.com>.
I think it's right to multiply by 1000 because usleep(t) sleeps for t microseconds not miliseconds. Right?

Igor

On Oct 17, 2010, at 12:03 PM, Jens Geyer wrote:

> In TFileTransport::readEvent()  the readTimeout_ is used this way:
> 
>   usleep(readTimeout_ * 1000);
> 
> However, there is an constant near the declaration of readTimeout_ which says
> 
> int32_t readTimeout_;
> static const int32_t DEFAULT_READ_TIMEOUT_MS = 200;
> 
> Thus applying the default value could cause a wait of 200 seconds, IMHO.
> 
> Correct?
> 
> JensG
> 
>