Fix deadlock issue in DeferredResult

Previously DeferredResult locked around the setting of the result
including handling up to the part of submitting a dispatch. This
can cause a deadlock if a timeout occurs at the same time since
the Tomcat timeout thread has its own locking that permits only
one thread to do timeout or dispatch processing.

The fix reduces the locking to cover only the attempt to set the
DeferredResult but not the dispatching.

Issue: SPR-10485
This commit is contained in:
Rossen Stoyanchev 2013-05-14 17:01:46 -04:00
parent 87ef99df5e
commit 25701ef984
1 changed files with 3 additions and 3 deletions

View File

@ -173,9 +173,9 @@ public class DeferredResult<T> {
return false;
}
this.result = result;
if (this.resultHandler != null) {
this.resultHandler.handleResult(this.result);
}
}
if (this.resultHandler != null) {
this.resultHandler.handleResult(this.result);
}
return true;
}