Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 630232 Details for
Bug 868403
Channel collision on federated link after creating/deleting ~64K bridges
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Quick patch to keep track of available channels
bz868403.patch (text/plain), 3.08 KB, created by
Jason Dillaman
on 2012-10-19 19:40:36 UTC
(
hide
)
Description:
Quick patch to keep track of available channels
Filename:
MIME Type:
Creator:
Jason Dillaman
Created:
2012-10-19 19:40:36 UTC
Size:
3.08 KB
patch
obsolete
>diff --git a/qpid/cpp/src/qpid/broker/Bridge.h b/qpid/cpp/src/qpid/broker/Bridge.h >index 2b4d019..da397b8 100644 >--- a/qpid/cpp/src/qpid/broker/Bridge.h >+++ b/qpid/cpp/src/qpid/broker/Bridge.h >@@ -65,6 +65,7 @@ class Bridge : public PersistableConfig, > > QPID_BROKER_EXTERN void close(); > bool isDurable() { return args.i_durable; } >+ framing::ChannelId getChannel() const { return channel; } > Link *getLink() const { return link; } > const std::string getSrc() const { return args.i_src; } > const std::string getDest() const { return args.i_dest; } >diff --git a/qpid/cpp/src/qpid/broker/Link.cpp b/qpid/cpp/src/qpid/broker/Link.cpp >index 517dbb7..2470cf7 100644 >--- a/qpid/cpp/src/qpid/broker/Link.cpp >+++ b/qpid/cpp/src/qpid/broker/Link.cpp >@@ -34,6 +34,7 @@ > #include "qpid/broker/Exchange.h" > #include "qpid/UrlArray.h" > #include "qpid/framing/FieldValue.h" >+#include <limits> > > namespace qpid { > namespace broker { >@@ -154,6 +155,7 @@ Link::Link(const string& _name, > currentInterval(1), > closing(false), > reconnectNext(0), // Index of next address for reconnecting in url. >+ freeChannels(1, std::numeric_limits<uint16_t>::max()), > channelCounter(1), > connection(0), > agent(0), >@@ -473,6 +475,7 @@ void Link::ioThreadProcessing() > if (!cancellations.empty()) { > for (Bridges::iterator i = cancellations.begin(); i != cancellations.end(); ++i) { > (*i)->cancel(*connection); >+ freeChannels += (*i)->getChannel(); > } > cancellations.clear(); > } >@@ -550,9 +553,16 @@ bool Link::hideManagement() const { > uint Link::nextChannel() > { > Mutex::ScopedLock mutex(lock); >- if (channelCounter >= framing::CHANNEL_MAX) >- channelCounter = 1; >- return channelCounter++; >+ for (uint16_t i = 0; i < std::numeric_limits<uint16_t>::max(); i++) { >+ uint16_t c = channelCounter++; >+ if (freeChannels.contains(c)) { >+ freeChannels -= c; >+ return c; >+ } >+ } >+ // If we get here, we didn't find any available channel. >+ throw Exception("There are no channels available"); >+ return 0; > } > > void Link::notifyConnectionForced(const string text) >diff --git a/qpid/cpp/src/qpid/broker/Link.h b/qpid/cpp/src/qpid/broker/Link.h >index 7c3377b..ccc7592 100644 >--- a/qpid/cpp/src/qpid/broker/Link.h >+++ b/qpid/cpp/src/qpid/broker/Link.h >@@ -30,6 +30,7 @@ > #include "qpid/broker/BrokerImportExport.h" > #include "qpid/sys/Mutex.h" > #include "qpid/framing/FieldTable.h" >+#include "qpid/RangeSet.h" > #include "qpid/management/Manageable.h" > #include "qpid/management/ManagementAgent.h" > #include "qmf/org/apache/qpid/broker/Link.h" >@@ -82,7 +83,8 @@ class Link : public PersistableConfig, public management::Manageable { > Bridges created; // Bridges pending creation > Bridges active; // Bridges active > Bridges cancellations; // Bridges pending cancellation >- uint channelCounter; >+ RangeSet<uint16_t> freeChannels; >+ uint16_t channelCounter; > Connection* connection; > management::ManagementAgent* agent; > boost::function<void(Link*)> listener; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 868403
: 630232