diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-11-27 14:34:15 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-11-27 14:34:15 +0100 |
commit | 08c354c1cb70485c1f0ed83f814b04383a24e233 (patch) | |
tree | 0229ebe7cf0cb38b8a00a34df7cfd8a90ddf8d3a /cpp/src/Ice/Outgoing.cpp | |
parent | ICE-5995 Use variable GRADLE not gradlew in makefile (diff) | |
download | ice-08c354c1cb70485c1f0ed83f814b04383a24e233.tar.bz2 ice-08c354c1cb70485c1f0ed83f814b04383a24e233.tar.xz ice-08c354c1cb70485c1f0ed83f814b04383a24e233.zip |
Fixed ICE-5985: Java background test failures
Diffstat (limited to 'cpp/src/Ice/Outgoing.cpp')
-rw-r--r-- | cpp/src/Ice/Outgoing.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp index 5f0361ba1ba..ee9464c28a8 100644 --- a/cpp/src/Ice/Outgoing.cpp +++ b/cpp/src/Ice/Outgoing.cpp @@ -196,6 +196,15 @@ Outgoing::completed(const Ice::Exception& ex) _monitor.notify(); } +void +Outgoing::retryException(const Ice::Exception&) +{ + Monitor<Mutex>::Lock sync(_monitor); + assert(_state <= StateInProgress); + _state = StateRetry; + _monitor.notify(); +} + bool Outgoing::invoke() { @@ -258,8 +267,12 @@ Outgoing::invoke() { Time now = Time::now(Time::Monotonic); timedOut = now >= _invocationTimeoutDeadline; - while((_state == StateInProgress || !_sent) && _state != StateFailed && !timedOut) + while((_state == StateInProgress || !_sent) && _state != StateFailed && _state != StateRetry) { + if(timedOut) + { + break; + } _monitor.timedWait(_invocationTimeoutDeadline - now); if((_state == StateInProgress || !_sent) && _state != StateFailed) @@ -271,7 +284,7 @@ Outgoing::invoke() } else { - while((_state == StateInProgress || !_sent) && _state != StateFailed) + while((_state == StateInProgress || !_sent) && _state != StateFailed && _state != StateRetry) { _monitor.wait(); } @@ -305,6 +318,11 @@ Outgoing::invoke() { _exception->ice_throw(); } + else if(_state == StateRetry) + { + _proxy->__setRequestHandler(_handler, 0); // Clear request handler and retry. + continue; + } else { assert(_state != StateInProgress); @@ -715,3 +733,9 @@ FlushBatch::completed(const Ice::Exception& ex) _exception.reset(ex.ice_clone()); _monitor.notify(); } + +void +FlushBatch::retryException(const Ice::Exception& ex) +{ + completed(ex); +} |