[jira] [Commented] (QPID-5868) Java client ignores exceptions when waiting on sync
[ https://issues.apache.org/jira/browse/QPID-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14052412#comment-14052412 ] Robbie Gemmell commented on QPID-5868: -- Like Keith, I wondered what exactly the original issue was, as its not clear the title/description fully conveys the required detail for the suggested change, though I think my comments below typed while looking at it mean I figured it out... Looking at what happens when an ExecutionException is received, it sets the exception on the Session, closes the session (but only after notifying the AMQSession_0_10 and ExceptionListener), takes the command lock and does a notify on it. That seems to point to any previously waiting thread in sync eventually being woken up, determining the session was closed, and throwing the exception. However, it is a bit iffy around what happens when notifying the AMQSession_0_10 and ExceptionListener before it actually marks the transport Session closed and wakes the waiting thread, which might make it possible for it to report a timeout rather the ExecutionException that caused it all. The change suggested would stop around that by tripping the boolean while setting the exception and causing the waiting thread to be woken before going near the AMQSession_0_10 or ExceptionListener, though it also means the Session will still marked open when the exception gets thrown by the waiter, rather than closed as it would have been before. Java client ignores exceptions when waiting on sync --- Key: QPID-5868 URL: https://issues.apache.org/jira/browse/QPID-5868 Project: Qpid Issue Type: Bug Components: Java Client Affects Versions: 0.27 Reporter: Rajith Attapattu Fix For: 0.29 Attachments: QPID-5868.patch The java client will wait on the sync command even if an execution exception is received from the broker. It will then proceed to throw a timeout exception and the execution exception is not reported properly to the application. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (QPID-5868) Java client ignores exceptions when waiting on sync
[ https://issues.apache.org/jira/browse/QPID-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14052509#comment-14052509 ] Rajith Attapattu commented on QPID-5868: As for the session being closed, once the message delivery lock gets released, the thread IO Receiver thread will continue and will call closed method on the Session which will mark it close. Java client ignores exceptions when waiting on sync --- Key: QPID-5868 URL: https://issues.apache.org/jira/browse/QPID-5868 Project: Qpid Issue Type: Bug Components: Java Client Affects Versions: 0.27 Reporter: Rajith Attapattu Fix For: 0.29 Attachments: QPID-5868.patch The java client will wait on the sync command even if an execution exception is received from the broker. It will then proceed to throw a timeout exception and the execution exception is not reported properly to the application. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (QPID-5868) Java client ignores exceptions when waiting on sync
[ https://issues.apache.org/jira/browse/QPID-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14052508#comment-14052508 ] Rajith Attapattu commented on QPID-5868: Apologies for not putting enough info in the JIRA. Robbie you description is correct. If an execution exception is thrown at the time close is initiated you can easily reproduce this issue. When notified of the exception the AMQSession_0_10 tries to close the session. However the thread is blocked waiting to grab the message delivery lock. But that lock is already taken by the thread that initiated the close and is blocked (timed wait) on the commandsLock waiting for the sync to complete. Once it times out, and since the session is still not closed, the exception being thrown is the time out exception and not the exception that caused the session close. Java client ignores exceptions when waiting on sync --- Key: QPID-5868 URL: https://issues.apache.org/jira/browse/QPID-5868 Project: Qpid Issue Type: Bug Components: Java Client Affects Versions: 0.27 Reporter: Rajith Attapattu Fix For: 0.29 Attachments: QPID-5868.patch The java client will wait on the sync command even if an execution exception is received from the broker. It will then proceed to throw a timeout exception and the execution exception is not reported properly to the application. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (QPID-5868) Java client ignores exceptions when waiting on sync
[ https://issues.apache.org/jira/browse/QPID-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14052722#comment-14052722 ] Rajith Attapattu commented on QPID-5868: I verified that both the transport session and the AMQSession_0_10 (jms session) are both marked closed by the time the exception is thrown to the application, which I think is the most important thing. Both the sync method and the exception method (called via the listener interface) delegates to setCurrentException method. Therefore which gets called first doesn't matter. Without the patch, important exceptions are not reported and customers have complained about it. Therefore I believe it's important to get this patch in. Java client ignores exceptions when waiting on sync --- Key: QPID-5868 URL: https://issues.apache.org/jira/browse/QPID-5868 Project: Qpid Issue Type: Bug Components: Java Client Affects Versions: 0.27 Reporter: Rajith Attapattu Fix For: 0.29 Attachments: QPID-5868.patch The java client will wait on the sync command even if an execution exception is received from the broker. It will then proceed to throw a timeout exception and the execution exception is not reported properly to the application. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org
[jira] [Commented] (QPID-5868) Java client ignores exceptions when waiting on sync
[ https://issues.apache.org/jira/browse/QPID-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14051832#comment-14051832 ] Keith Wall commented on QPID-5868: -- Hello Rajith, I'm sure you've realised already but org.apache.qpid.transport.Session is shared code and is used by the Java Broker for its 0-10 support. Please keep in mind the need to test it too with any changes. I'm also not too clear on the problem you are solving. I'd like to understand more. I am forcing a situation where the Java Broker will produce an ExecutionException by trying to delete a queue that does not exist thus: {code} AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE); session.sendQueueDelete(new AMQShortString(wibble)); {code} Now, when I run this, I get a immediate AMQException wrapping the NOT_FOUND execution exception from the client. I don't see a timeout. What is your test case? org.apache.qpid.AMQException: ch=0 id=0 ExecutionException(errorCode=NOT_FOUND, commandId=0, description=No queue wibble found) [error code 404: not found] at org.apache.qpid.client.AMQSession_0_10.setCurrentException(AMQSession_0_10.java:1085) at org.apache.qpid.client.AMQSession_0_10.sync(AMQSession_0_10.java:1065) at org.apache.qpid.client.AMQSession_0_10.sendQueueDelete(AMQSession_0_10.java:829) at org.apache.qpid.example.Hello.runTest(Hello.java:62) at org.apache.qpid.example.Hello.main(Hello.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Java client ignores exceptions when waiting on sync --- Key: QPID-5868 URL: https://issues.apache.org/jira/browse/QPID-5868 Project: Qpid Issue Type: Bug Components: Java Client Affects Versions: 0.27 Reporter: Rajith Attapattu Fix For: 0.29 Attachments: QPID-5868.patch The java client will wait on the sync command even if an execution exception is received from the broker. It will then proceed to throw a timeout exception and the execution exception is not reported properly to the application. -- This message was sent by Atlassian JIRA (v6.2#6252) - To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org