qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Rudyy (JIRA)" <j...@apache.org>
Subject [jira] [Created] (QPID-6847) [JMS AMQP 1.0 Client] Deadlock during commit on sending message
Date Fri, 13 Nov 2015 13:26:11 GMT
Alex Rudyy created QPID-6847:
--------------------------------

             Summary: [JMS AMQP 1.0 Client] Deadlock during commit on sending message
                 Key: QPID-6847
                 URL: https://issues.apache.org/jira/browse/QPID-6847
             Project: Qpid
          Issue Type: Bug
          Components: JMS AMQP 1.0 Client
    Affects Versions: 0.32
            Reporter: Alex Rudyy


On committing sending transaction client can ran into deadlock

{noformat}
Found one Java-level deadlock:
=============================
"QpidConnectionInputThread-0":
  waiting to lock monitor 0x00007f60a40047f8 (object 0x00000006c70614c8, a org.apache.qpid.amqp_1_0.client.TransactionController),
  which is held by "main"
"main":
  waiting to lock monitor 0x00007f60a4005be8 (object 0x00000006c700cc90, a org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint),
  which is held by "QpidConnectionInputThread-0"

Java stack information for the threads listed above:
===================================================
"QpidConnectionInputThread-0":
	at org.apache.qpid.amqp_1_0.client.TransactionController.handle(TransactionController.java:203)
	- waiting to lock <0x00000006c70614c8> (a org.apache.qpid.amqp_1_0.client.TransactionController)
	at org.apache.qpid.amqp_1_0.transport.LinkEndpoint.receiveDeliveryState(LinkEndpoint.java:229)
	- locked <0x00000006c700cc90> (a org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
	at org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint.receiveDeliveryState(SendingLinkEndpoint.java:196)
	at org.apache.qpid.amqp_1_0.transport.SessionEndpoint.receiveDisposition(SessionEndpoint.java:527)
	at org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.receiveDisposition(ConnectionEndpoint.java:664)
	- eliminated <0x00000006c700cc90> (a org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
	at org.apache.qpid.amqp_1_0.type.transport.Disposition.invoke(Disposition.java:180)
	at org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint.receive(ConnectionEndpoint.java:808)
	- locked <0x00000006c700cc90> (a org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
	at org.apache.qpid.amqp_1_0.framing.FrameHandler.parse(FrameHandler.java:241)
	at org.apache.qpid.amqp_1_0.framing.ConnectionHandler.parse(ConnectionHandler.java:75)
	at org.apache.qpid.amqp_1_0.client.TCPTransportProvider.doRead(TCPTransportProvider.java:244)
	at org.apache.qpid.amqp_1_0.client.TCPTransportProvider.access$000(TCPTransportProvider.java:47)
	at org.apache.qpid.amqp_1_0.client.TCPTransportProvider$1.run(TCPTransportProvider.java:185)
	at java.lang.Thread.run(Thread.java:745)
"main":
	at org.apache.qpid.amqp_1_0.transport.LinkEndpoint.isDetached(LinkEndpoint.java:326)
	- waiting to lock <0x00000006c700cc90> (a org.apache.qpid.amqp_1_0.transport.ConnectionEndpoint)
	at org.apache.qpid.amqp_1_0.client.TransactionController.waitForResponse(TransactionController.java:118)
	- locked <0x00000006c70614c8> (a org.apache.qpid.amqp_1_0.client.TransactionController)
	at org.apache.qpid.amqp_1_0.client.TransactionController.declare(TransactionController.java:108)
	at org.apache.qpid.amqp_1_0.client.TransactionController.beginTransaction(TransactionController.java:71)
	at org.apache.qpid.amqp_1_0.client.Session.createSessionLocalTransaction(Session.java:387)
	at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.commit(SessionImpl.java:250)
	at Test.main(Test.java:43)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Found 1 deadlock.

Heap
 PSYoungGen      total 110592K, used 56253K [0x000000076d000000, 0x000000077c800000, 0x00000007c0000000)
  eden space 110080K, 51% used [0x000000076d000000,0x00000007706e7610,0x0000000773b80000)
  from space 512K, 6% used [0x000000077c780000,0x000000077c788000,0x000000077c800000)
  to   space 5632K, 0% used [0x000000077bd00000,0x000000077bd00000,0x000000077c280000)
 ParOldGen       total 171008K, used 2372K [0x00000006c7000000, 0x00000006d1700000, 0x000000076d000000)
  object space 171008K, 1% used [0x00000006c7000000,0x00000006c7251100,0x00000006d1700000)
 Metaspace       used 10155K, capacity 10336K, committed 10496K, reserved 1058816K
  class space    used 1191K, capacity 1248K, committed 1280K, reserved 1048576K

{noformat}

It can be reproduced with the following:

{code}
Properties jndi = new Properties();
        jndi.put("java.naming.factory.initial", "org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory");
        jndi.put("connectionfactory.qpidConnectionfactory", "amqp://guest:guest@localhost:5672?clientid=test-client&remote-host=default");
        int numberOfMessages = 250000;
        Context initialContext = new InitialContext(jndi);

        ConnectionFactory  connectionFactory = (ConnectionFactory)initialContext.lookup("qpidConnectionfactory");
        Connection conn = connectionFactory.createConnection();
        Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
        Destination destination = sess.createQueue("test-queue");
        MessageProducer prod = sess.createProducer(destination);
        final Message message = sess.createTextMessage();
        for (int i = 0 ; i < numberOfMessages; i++)
        {
            System.err.println("Sending Message " + i);
            prod.send(message);
            sess.commit();
        }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message