diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-09-27 10:07:56 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-09-27 10:07:56 +0200 |
commit | 8998b9bc4b7eecc378251c86a7ca97df81105b0c (patch) | |
tree | 21861c6999b9ac60e0f370fef908379587db0057 | |
parent | More javadoc fixes (diff) | |
download | ice-8998b9bc4b7eecc378251c86a7ca97df81105b0c.tar.bz2 ice-8998b9bc4b7eecc378251c86a7ca97df81105b0c.tar.xz ice-8998b9bc4b7eecc378251c86a7ca97df81105b0c.zip |
Fixed ICE-7377 - IceStorm shutdown hang
-rw-r--r-- | cpp/src/IceStorm/Subscriber.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/cpp/src/IceStorm/Subscriber.cpp b/cpp/src/IceStorm/Subscriber.cpp index e00f737cc7c..f5bea5938b2 100644 --- a/cpp/src/IceStorm/Subscriber.cpp +++ b/cpp/src/IceStorm/Subscriber.cpp @@ -690,6 +690,7 @@ Subscriber::queue(bool forwarded, const EventDataSeq& events) if(_instance->sendQueueSizeMaxPolicy() == Instance::RemoveSubscriber) { error(false, IceStorm::SendQueueSizeMaxReached(__FILE__, __LINE__)); + return false; } else // DropEvents { @@ -784,10 +785,24 @@ Subscriber::error(bool dec, const Ice::Exception& e) assert(_outstanding >= 0 && _outstanding < _maxOutstanding); } + // + // It's possible to be already in the error state if the queue maximum size + // has been reached or if an ObjectNotExistException occured before. + // + if(_state >= SubscriberStateError) + { + if(_shutdown) + { + _lock.notify(); + } + return; + } + // A hard error is an ObjectNotExistException or // NotRegisteredException. bool hardError = dynamic_cast<const Ice::ObjectNotExistException*>(&e) || - dynamic_cast<const Ice::NotRegisteredException*>(&e); + dynamic_cast<const Ice::NotRegisteredException*>(&e) || + dynamic_cast<const IceStorm::SendQueueSizeMaxReached*>(&e); // // A twoway subscriber can queue multiple send events and |