Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,15 @@ private String buildDetailedErrorMsg(String string, int index) {
@Override
public void waitUntilDone() throws InterruptedIOException {
try {
waitUntilDone(Long.MAX_VALUE);
if (this.operationTimeout > 0) {
// the worker thread maybe over by some exception without decrement the actionsInProgress,
// then the guarantee of operationTimeout will be broken, so we should set cutoff to avoid
// stuck here forever
long cutoff = (EnvironmentEdgeManager.currentTime() + this.operationTimeout) * 1000L;
waitUntilDone(cutoff);
} else {
waitUntilDone(Long.MAX_VALUE);
}
} catch (InterruptedException iex) {
throw new InterruptedIOException(iex.getMessage());
} finally {
Expand Down