qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Wong (JIRA)" <qpid-...@incubator.apache.org>
Subject [jira] Created: (QPID-2871) QPID management is stuck in a waiting state for broker sync during rapid federation/defederation using the Java management API
Date Sun, 19 Sep 2010 01:32:33 GMT
QPID management is stuck in a waiting state for broker sync during rapid federation/defederation
using the Java management API
------------------------------------------------------------------------------------------------------------------------------

                 Key: QPID-2871
                 URL: https://issues.apache.org/jira/browse/QPID-2871
             Project: Qpid
          Issue Type: Bug
          Components: Java Common
    Affects Versions: 0.6
         Environment: RHEL 5.5, MRG-M 1,1, QPID Java Management API 0.6, 100GB hard drive,
4GB RAM, virtualized using VMWare
            Reporter: Jason Wong
            Priority: Critical


We used the QPID Java Management API to create a Java library to replicate the qpid-route
CLI tool.  When we rapidly federated, un-federated, and re-federated brokers, the broker's
management component would become unresponsive to any other commands.  Looking for locked
or waiting threads, we noticed that the following class was consistently in a waiting state.

org.apache.qpid.console.Broker in the qpid-management-console.jar

Looking at the latest source we noticed that in the Broker.java waitForSync method the timeout
check that throws a ConsoleException (line 498) is outside of the while loop (line 487-496)
that is waiting for the broker to sync.  We downloaded the source, put the timeout check inside
the while loop, and compiled a new version of the qpid-management-console.jar.  When we ran
our original scenario, the broker's management component never became unresponsive.  We did
get some ConsoleExceptions thrown as we expected when we rapdily sent federation commands.
 The line numbers above were taken from revision 998162 (http://svn.apache.org/viewvc/qpid/trunk/qpid/java/management/console/src/main/java/org/apache/qpid/console/Broker.java?view=markup).

Updated code for the waitForSync method:
    public void waitForSync(int timeout)
    {
        synchronized (lockObject)
        {
            long start = System.currentTimeMillis();
            while (syncInFlight)
            {
                try
                {
                    lockObject.wait(SYNC_TIME);
                } catch (Exception e)
                {
                    throw new ConsoleException(e);
                }
                long duration = System.currentTimeMillis() - start;
                if (duration > timeout)
                {
                    throw new ConsoleException("Timeout waiting for Broker to Sync");
                }
            }
        }
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Mime
View raw message