Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
[JENKINS-48309] - Prevent TimeoutException in AsyncFutureImpl in the case of spurious wakeups #240
TL;DR: A large part of Jenkins’ get-with-timeout logic is a subject for improper exit before the timeout.
It happens, because "wait(timeout)" is not in the loop. Object#wait(long) is explicit about that: "A thread can also wake up without being notified, interrupted, or timing out, a so-called spurious wakeup. While this will rarely occur in practice, applications must guard against it by testing for the condition that should have caused the thread to be awakened, and continuing to wait if the condition is not satisfied. In other words, waits should always occur in loops..."
Probably it causes https://issues.jenkins-ci.org/browse/JENKINS-20947, not 100% sure.