Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.8.0
-
None
Description
DefaultSshFuture.awaitInterruptibly() works by setting a timeout of Long.MAX_VALUE. When you add this to System.currentTimeMillis(), you get a time very much in the past, since the value wraps to the negatives.
Later, to detect timeout, await0() does this upon being woken up:
if (ready)
{ return true; } else {
if (endTime < System.currentTimeMillis())
}
Thus the ready check, which prevents spurious wakeups, never prevents spurious wakeups in the case that no timeout is specified.
To fix this, endTime itself could simply be set to Long.MAX_VALUE rather than ADDING Long.MAX_VALUE to the current time.