Search in sources :

Example 1 with NotFoundException

use of com.yahoo.vespa.config.server.NotFoundException in project vespa by vespa-engine.

the class SessionRepo method internalGetSession.

private synchronized SESSIONTYPE internalGetSession(long id, long timeoutInMillis) throws InterruptedException {
    TimeoutBudget timeoutBudget = new TimeoutBudget(Clock.systemUTC(), Duration.ofMillis(timeoutInMillis));
    do {
        SESSIONTYPE session = getSession(id);
        if (session != null) {
            return session;
        }
        wait(100);
    } while (timeoutBudget.hasTimeLeft());
    throw new NotFoundException("Unable to retrieve session with id " + id + " before timeout was reached");
}
Also used : NotFoundException(com.yahoo.vespa.config.server.NotFoundException) TimeoutBudget(com.yahoo.vespa.config.server.TimeoutBudget)

Aggregations

NotFoundException (com.yahoo.vespa.config.server.NotFoundException)1 TimeoutBudget (com.yahoo.vespa.config.server.TimeoutBudget)1