You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2018/10/23 20:54:54 UTC

Deadline computation

Hi All:

In methods
like org.apache.hc.core5.pool.StrictConnPool.closeIdle(TimeValue), I see:

  final long deadline = System.currentTimeMillis() -
(TimeValue.isPositive(idleTime) ? idleTime.toMillis() : 0);

Which is a bit odd since deadlines are usually in the future. Can someone
explain or add a comment to explain this. I think this would help make the
code more maintainable.

Gary

Re: Deadline computation

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Oct 25, 2018 at 2:21 AM Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2018-10-24 at 18:13 +0000, Schmitt, Ryan wrote:
> > `idleExpirationTime`?
> >
>
> Sounds better, does it not?
>

Yes! :-)

Gary

>
> Oleg
>
>
> > On 10/24/18, 1:04 AM, "Oleg Kalnichevski" <ol...@apache.org> wrote:
> >
> >     On Tue, 2018-10-23 at 14:54 -0600, Gary Gregory wrote:
> >     > Hi All:
> >     >
> >     > In methods
> >     > like
> > org.apache.hc.core5.pool.StrictConnPool.closeIdle(TimeValue), I
> >     > see:
> >     >
> >     >   final long deadline = System.currentTimeMillis() -
> >     > (TimeValue.isPositive(idleTime) ? idleTime.toMillis() : 0);
> >     >
> >     > Which is a bit odd since deadlines are usually in the future.
> >
> >     Hi Gary
> >
> >     There might be a better term in English but this value represents
> > a
> >     point time beyond which connections can be considered as being
> > idle too
> >     long and subject to eviction from the pool.
> >
> >     Oleg
> >
> >
> >     > Can someone
> >     > explain or add a comment to explain this. I think this would
> > help
> >     > make the
> >     > code more maintainable.
> >     >
> >     > Gary
> >
> >
> >     >
> >     Gary
> >
> >
> >     Oleg
> >
> >
> >     -----------------------------------------------------------------
> > ----
> >     To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >     For additional commands, e-mail: dev-help@hc.apache.org
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: Deadline computation

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2018-10-24 at 18:13 +0000, Schmitt, Ryan wrote:
> `idleExpirationTime`?
> 

Sounds better, does it not?

Oleg


> On 10/24/18, 1:04 AM, "Oleg Kalnichevski" <ol...@apache.org> wrote:
> 
>     On Tue, 2018-10-23 at 14:54 -0600, Gary Gregory wrote:
>     > Hi All:
>     > 
>     > In methods
>     > like
> org.apache.hc.core5.pool.StrictConnPool.closeIdle(TimeValue), I
>     > see:
>     > 
>     >   final long deadline = System.currentTimeMillis() -
>     > (TimeValue.isPositive(idleTime) ? idleTime.toMillis() : 0);
>     > 
>     > Which is a bit odd since deadlines are usually in the future. 
>     
>     Hi Gary
>     
>     There might be a better term in English but this value represents
> a
>     point time beyond which connections can be considered as being
> idle too
>     long and subject to eviction from the pool.
>     
>     Oleg
>     
>     
>     > Can someone
>     > explain or add a comment to explain this. I think this would
> help
>     > make the
>     > code more maintainable.
>     > 
>     > Gary
>     
>     
>     > 
>     Gary
>     
>     
>     Oleg
>     
>     
>     -----------------------------------------------------------------
> ----
>     To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>     For additional commands, e-mail: dev-help@hc.apache.org
>     
>     
>     
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Deadline computation

Posted by "Schmitt, Ryan" <ry...@amazon.com.INVALID>.
`idleExpirationTime`?

On 10/24/18, 1:04 AM, "Oleg Kalnichevski" <ol...@apache.org> wrote:

    On Tue, 2018-10-23 at 14:54 -0600, Gary Gregory wrote:
    > Hi All:
    > 
    > In methods
    > like org.apache.hc.core5.pool.StrictConnPool.closeIdle(TimeValue), I
    > see:
    > 
    >   final long deadline = System.currentTimeMillis() -
    > (TimeValue.isPositive(idleTime) ? idleTime.toMillis() : 0);
    > 
    > Which is a bit odd since deadlines are usually in the future. 
    
    Hi Gary
    
    There might be a better term in English but this value represents a
    point time beyond which connections can be considered as being idle too
    long and subject to eviction from the pool.
    
    Oleg
    
    
    > Can someone
    > explain or add a comment to explain this. I think this would help
    > make the
    > code more maintainable.
    > 
    > Gary
    
    
    > 
    Gary
    
    
    Oleg
    
    
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
    For additional commands, e-mail: dev-help@hc.apache.org
    
    
    


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Re: Deadline computation

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2018-10-23 at 14:54 -0600, Gary Gregory wrote:
> Hi All:
> 
> In methods
> like org.apache.hc.core5.pool.StrictConnPool.closeIdle(TimeValue), I
> see:
> 
>   final long deadline = System.currentTimeMillis() -
> (TimeValue.isPositive(idleTime) ? idleTime.toMillis() : 0);
> 
> Which is a bit odd since deadlines are usually in the future. 

Hi Gary

There might be a better term in English but this value represents a
point time beyond which connections can be considered as being idle too
long and subject to eviction from the pool.

Oleg


> Can someone
> explain or add a comment to explain this. I think this would help
> make the
> code more maintainable.
> 
> Gary


> 
Gary


Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org