diff options
| author | Ted Ross <tross@apache.org> | 2011-07-12 18:29:22 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2011-07-12 18:29:22 +0000 |
| commit | 8a0caaf73b8f0559eef1272cab4a4a88246a7259 (patch) | |
| tree | bd7a55221e8ef11f2d95676f1fe2d860cd8cff9c /cpp/src/qpid/broker/Link.cpp | |
| parent | 90c372a1ba7a3f79ffeb362eba5bc06bd90d3fbf (diff) | |
| download | qpid-python-8a0caaf73b8f0559eef1272cab4a4a88246a7259.tar.gz | |
QPID-3352 - Federation bridge doesn't recover from session errors
Applied patch from Jason Dillaman
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1145706 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Link.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Link.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/Link.cpp b/cpp/src/qpid/broker/Link.cpp index 9ab4379a69..8010bf43e7 100644 --- a/cpp/src/qpid/broker/Link.cpp +++ b/cpp/src/qpid/broker/Link.cpp @@ -248,6 +248,19 @@ void Link::ioThreadProcessing() return; QPID_LOG(debug, "Link::ioThreadProcessing()"); + // check for bridge session errors and recover + if (!active.empty()) { + Bridges::iterator removed = std::remove_if( + active.begin(), active.end(), !boost::bind(&Bridge::isSessionReady, _1)); + for (Bridges::iterator i = removed; i != active.end(); ++i) { + Bridge::shared_ptr bridge = *i; + bridge->closed(); + bridge->cancel(*connection); + created.push_back(bridge); + } + active.erase(removed, active.end()); + } + //process any pending creates and/or cancellations if (!created.empty()) { for (Bridges::iterator i = created.begin(); i != created.end(); ++i) { @@ -296,7 +309,7 @@ void Link::maintenanceVisit () } } } - else if (state == STATE_OPERATIONAL && (!created.empty() || !cancellations.empty()) && connection != 0) + else if (state == STATE_OPERATIONAL && (!active.empty() || !created.empty() || !cancellations.empty()) && connection != 0) connection->requestIOProcessing (boost::bind(&Link::ioThreadProcessing, this)); } |
