Skip to content

Commit

Permalink
Merge pull request #145 from onagano-rh/async-void-ejb
Browse files Browse the repository at this point in the history
[EJBCLIENT-156] Calling remote asynchronous void method causes OutOfMemoryError in direct buffer memory
  • Loading branch information
dmlloyd committed Apr 21, 2016
2 parents e9d44b0 + 9f7b8fd commit 4c08317
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void setDiscardResult() {
asyncState = AsyncState.ONE_WAY;
lock.notifyAll();
}
if (state != State.DONE) {
if (state == State.DONE) {
return;
}
// result is waiting, discard it
Expand All @@ -473,7 +473,11 @@ void setDiscardResult() {
lock.notifyAll();
// fall out of the lock to discard the result
}
resultProducer.discardResult();
// If task thread invoked #resultReady() method before current thread invokes this methods,
// then #state in #resultReady() was WAITING. Therefore resultProducer.discardResult() in
// #resultReady() was not invoked.
// In the reverse of the pattern, resultProducer is null.
if(resultProducer != null) resultProducer.discardResult();
}

void cancelled() {
Expand Down

0 comments on commit 4c08317

Please sign in to comment.