directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Carlo.Acco...@ibs-ag.com>
Subject RE: LdapNetworkConnection.java - Time units for timeout
Date Wed, 06 Feb 2013 18:01:59 GMT
OK If we're supposed to use milliseconds everywhere, not a problem. Needing smaller times for
testing makes sense. 

Just for clarification though, when calling  .setTimeLimit(intTimeout) in SearchRequestImpl
 this should be milliseconds? 

The API doc refers to the value in seconds.
public SearchRequest setTimeLimit(int secondsMax)

Also in SearchRequestImpl  the time limit is declared as seconds

    /** Max seconds to wait for search to complete */
    private int timeLimit;

Just making sure.. Thanks


-----Original Message-----
From: Emmanuel Lécharny [mailto:elecharny@gmail.com] 
Sent: Wednesday, February 06, 2013 12:47 PM
To: users@directory.apache.org
Subject: Re: LdapNetworkConnection.java - Time units for timeout

Le 2/6/13 6:38 PM, Carlo.Accorsi@ibs-ag.com a écrit :
> I'm trying to understand why I'm getting what seems like a premature timeout.
>
> When I set the timeout in my search request, I believe it is in seconds.
> SearchRequest.setTimeLimit(5); // seconds
>
> When I try to get a search cursor,
> SearchCursor cur =  LdapNetworkConnection. search(SearchRequest);
>
> it times out with this error
> org.apache.directory.api.ldap.model.exception.LdapException: TimeOut occurred
>        at 
> org.apache.directory.ldap.client.api.SearchCursorImpl.next(SearchCurso
> rImpl.java:140)
>
>
> I think LdapNetworkConnection.java line 1595 treats the seconds as milliseconds ?
>
> I'm just setting my timeout to 0 to get around this for now.. Thanks.

To be a bit more specific, we made it using milliseconds because we use it for tests, and
in tests, we want to wait as less as possible, thus we use timeout like 100ms or 200ms. Waiting
one second, when we have hundreds of tests to run, is just painful :/



--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Mime
View raw message