Red Hat Bugzilla – Bug 599700
Console examples sometimes fail due to not waiting for the broker connection to complete
Last modified: 2011-08-12 12:04:23 EDT
Description of problem:
The 'ping' and 'console' examples in cpp/examples/qmf-console intermittently fail because they try to start operating against a broker that is not yet connected.
Version-Release number of selected component (if applicable):
very - the Ping example fails for me 100% of the time (i.e. the first ping doesn't go out)
Steps to Reproduce:
1. start a broker
2. run the "ping" example from cpp/examples/qmf-console
One of five pings are unsuccessful
All pings successful
This can also be seen using the 'console' example. In this case, the example may not return any data.
Fixed upstream in revision 951141.
Note that a new method was exposed as public: Broker::waitForStable()
This can be used after calling addBroker() to ensure that it is connected and stable prior to invoking getObjects, etc. on the session.