Issue Details (XML | Word | Printable)

Key: KATTA-169
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Patrick Crenshaw
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Katta

results do not get closed in WorkQueue.getResults() if waitTime == 0

Created: 13/Dec/10 03:56 PM   Updated: 26/May/11 07:26 AM
Component/s: search
Affects Version/s: 0.6.3
Fix Version/s: 0.6.5


 Description  « Hide
The timeout code in WorkQueue.java (I removed some log lines from the
code below for clarity) seems to have an issue if the waitTime is
exactly 0. Looks like it will return the results without closing them if
waitTime is exactly 0.

/**

  • Use a user-provided policy to decide how long to wait for and
    whether to
  • terminate the call.
    *
  • @param policy
  • How to decide when to return and to terminate the call.
  • @return the results, which may or may not be complete and/or closed.
    */
    public ClientResult<T> getResults(IResultPolicy<T> policy) {
    int callId = callCounter++;
    long start = 0;
    long waitTime = 0;
    while (true) {
    synchronized (results) {
    // Need to stay synchronized before waitTime() through wait()
    or we will
    // miss notifications.
    waitTime = policy.waitTime(results);
    if (waitTime > 0 && !results.isClosed())
    Unknown macro: { try { results.wait(waitTime); } catch (InterruptedException e) { LOG.debug("Interrupted", e); } }
    else { break; }
    }
    }
    if (waitTime < 0) { // shouldn't this be waitTime <= 0 ? executor.shutdownNow(); results.close(); }
    return results;
    }


 All   Comments   Change History   git Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.