[ 
https://issues.apache.org/jira/browse/QPID-8212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16535069#comment-16535069
 ] 

Alex Rudyy commented on QPID-8212:
----------------------------------

The implemented change is not ideal. It only partially fixes an issue for  
consumer close.
For example, when {{ChannelClose}} arrives from aBroker when consumer is 
closing and awaiting for {{BasicCancelOk}},  it can also results in ignoring of 
{{BasicCancelOk}} and blocking the consumer. In fact, with the changes 
implemented in QPID-8185, all calls to {{AMQProtocolHandler#syncWrite}} sent 
over closing channel can end up in timeouts when {{ChannelClose}} arrives from 
the Broker after sync method is sent and client is awaiting for corresponding 
{{Ok}} to arrive. IMHO, the awaiting should be interrupted on receiving of 
{{ChannelClose}}.
The receipt of {{ConnectionClose}} interrupts all awaiting listeners. It seems 
that receipt of {{ChannelClose}} should interrupt all awaiting listeners for 
commands sent over the closing channel.

I think we should notify all awaiting listeners for the closing channel on 
receipt of {{ChannelClose}} and include corresponding changes  into 6.3.2. Any 
objections?

> [JMS AMQP 0-x][AMQP 0-8..0-91] Consumer close can block for 60 seconds and 
> endup in time-out exception
> ------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-8212
>                 URL: https://issues.apache.org/jira/browse/QPID-8212
>             Project: Qpid
>          Issue Type: Bug
>          Components: JMS AMQP 0-x
>    Affects Versions: qpid-java-client-0-x-6.3.1
>            Reporter: Alex Rudyy
>            Assignee: Alex Rudyy
>            Priority: Blocker
>             Fix For: qpid-java-client-0-x-6.3.2
>
>
> When method {{MessageConsumer#close()}} is invoked in one thread and method 
> {{Connection#close()}} is invoked in another thread, the incoming 
> {{BasicCancelOk}} frame can be ignored due to {{true}} being returned from 
> {{Session#isClosed()}}  because of {{Connection#_closed}} flag being set to 
> true on connection close. As result, the call to {{MessageConsumer#close()}} 
> can block for 60 seconds and end up in exception due to not being able to 
> receive {{BasicCancelOk}}. Invocation of {{Connection#close()}} also gets 
> blocked as message delivery lock being hold on consumer close.
> The defect was introduced as part of changes made against QPID-8185 in commit 
>  
> [f89f6c2f45d11fc63551d0d61c17eceedd6bd247|https://git-wip-us.apache.org/repos/asf?p=qpid-jms-amqp-0-x.git;h=f89f6c2]
> Method {{AMQProtocolSession#isClosedForInput}} checks whether session is 
> closed for input by calling {{AMQSession#isClosed()}}. The latter returns 
> true when either {{AMQSession#_closed}} or {{AMQConnection#_closed}} holds 
> {{true}}. Only {{AMQSession#_closed}} should be checked in 
> {{AMQProtocolSession#isClosedForInput}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to