You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by gaohoward <gi...@git.apache.org> on 2017/08/01 12:09:10 UTC

[GitHub] activemq-artemis pull request #1434: ARTEMIS-1315 Client disconnection may c...

GitHub user gaohoward opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1434

    ARTEMIS-1315 Client disconnection may cause consumer to hang

    When calling a consumer to receive message with a timeout
    (receive(long timeout), if the consumer's buffer is empty, it sends
    a 'forced delivery' the waiting forever, expecting the server to
    send back a 'forced delivery" message if the queue is empty.
    
    If the connection is disconnected as the arrived 'forced
    delivery' message is corrupted, this 'forced delivery' message
    never gets to consumer. After the session is reconnected,
    the consumer never knows that and stays waiting.
    
    To fix that we can send a 'forced delivery' to server right
    after the session is reconnected.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gaohoward/activemq-artemis lmaster_1315

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1434.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1434
    
----
commit a702125a102588556bbb8f2971f3f100c3f4eece
Author: Howard Gao <ho...@gmail.com>
Date:   2017-08-01T11:49:11Z

    ARTEMIS-1315 Client disconnection may cause consumer to hang
    
    When calling a consumer to receive message with a timeout
    (receive(long timeout), if the consumer's buffer is empty, it sends
    a 'forced delivery' the waiting forever, expecting the server to
    send back a 'forced delivery" message if the queue is empty.
    
    If the connection is disconnected as the arrived 'forced
    delivery' message is corrupted, this 'forced delivery' message
    never gets to consumer. After the session is reconnected,
    the consumer never knows that and stays waiting.
    
    To fix that we can send a 'forced delivery' to server right
    after the session is reconnected.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #1434: ARTEMIS-1315 Client disconnection may c...

Posted by clebertsuconic <gi...@git.apache.org>.
Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1434#discussion_r130675636
  
    --- Diff: artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ActiveMQSessionContext.java ---
    @@ -717,6 +717,19 @@ public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) th
              SessionConsumerFlowCreditMessage packet = new SessionConsumerFlowCreditMessage(getConsumerID(consumerInternal), 1);
              sendPacketWithoutLock(sessionChannel, packet);
           }
    +
    +      //force a delivery to avoid a infinite waiting
    +      //it can happen when the consumer sends a 'forced delivery' then
    +      //waiting forever, while the connection is broken and the server's
    +      //'forced delivery' message never gets to consumer. If session
    +      //is reconnected, its consumer never knows and stays waiting.
    +      //note this message will either be ignored by consumer (forceDeliveryCount
    +      //doesn't match, which is fine) or be caught by consumer
    +      //(in which case the consumer will wake up, thus avoid the infinite waiting).
    +      if (isSessionStarted) {
    --- End diff --
    
    this should been:
    
    ```java
    if (isSessionStarted && consumerInternal.getForceDeliveryCount() > 0) {
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis pull request #1434: ARTEMIS-1315 Client disconnection may c...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/1434


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] activemq-artemis issue #1434: ARTEMIS-1315 Client disconnection may cause co...

Posted by gaohoward <gi...@git.apache.org>.
Github user gaohoward commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1434
  
    @clebertsuconic corrected. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---