You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Colin MacNaughton (JIRA)" <ji...@apache.org> on 2009/09/25 03:27:51 UTC

[jira] Created: (AMQ-2413) Hangs possible because of Queue.doPageIn

Hangs possible because of Queue.doPageIn
----------------------------------------

                 Key: AMQ-2413
                 URL: https://issues.apache.org/activemq/browse/AMQ-2413
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.4.0
         Environment: 5.4 branch 818147. Some changes after this hide this error, but I'm still concerned it might be a problem.
            Reporter: Colin MacNaughton
            Priority: Critical


I don't understand the intent of the following code in Queue.doPageIn() and in rev 818147 it was causing delivery to the consumer to get hung (temporarily until message expiration check kickstarts it again). See the commented out lines of code that determine how many messages to attempt to page in. 

{code}
    private List<QueueMessageReference> doPageIn(boolean force) throws Exception {
        List<QueueMessageReference> result = null;
        List<QueueMessageReference> resultList = null;
        synchronized(dispatchMutex) {
            //WHAT IS THIS DOING?
            //int toPageIn = getMaxPageSize() + Math.max(0, (int)destinationStatistics.getInflight().getCount()) -pagedInMessages.size();

            //DOES THIS MAKE MORE SENSE:
            int toPageIn = Math.min(getMaxPageSize(), messages.size());
            
            if (LOG.isDebugEnabled()) {
                LOG.debug(destination.getPhysicalName() + " toPageIn: "  + toPageIn + ", Inflight: "
                        + destinationStatistics.getInflight().getCount()
                        + ", pagedInMessages.size " + pagedInMessages.size());
            }
            
            //WHAT IS THIS DOING?
            //toPageIn = Math.max(0, Math.min(toPageIn, getMaxPageSize()));
                       
            if (isLazyDispatch()&& !force) {
                // Only page in the minimum number of messages which can be dispatched immediately.
                toPageIn = Math.min(getConsumerMessageCountBeforeFull(), toPageIn);
            }
   
{code}

It is definitely possible that I'm just not understanding the intent of the code, but whatever it is, it's not working, and consequently I'm not sure that the subsequent fixes on the branch have eliminated the problem. The attached patch contains both a unit test, that tests several combinations of ack mode, vm cursoring, and delivery mode, as well as version of Queue which should be applied against revirion 818147 -- this version has the fix commented out and preserves the buggy behavior

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


[jira] Updated: (AMQ-2413) Hangs possible because of Queue.doPageIn

Posted by "Colin MacNaughton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colin MacNaughton updated AMQ-2413:
-----------------------------------

    Attachment: AMQ-2413patch.txt

Patch with unit test and proposed fix. 

> Hangs possible because of Queue.doPageIn
> ----------------------------------------
>
>                 Key: AMQ-2413
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2413
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.0
>         Environment: 5.4 branch 818147. Some changes after this hide this error, but I'm still concerned it might be a problem.
>            Reporter: Colin MacNaughton
>            Priority: Critical
>         Attachments: AMQ-2413patch.txt
>
>
> I don't understand the intent of the following code in Queue.doPageIn() and in rev 818147 it was causing delivery to the consumer to get hung (temporarily until message expiration check kickstarts it again). See the commented out lines of code that determine how many messages to attempt to page in. 
> {code}
>     private List<QueueMessageReference> doPageIn(boolean force) throws Exception {
>         List<QueueMessageReference> result = null;
>         List<QueueMessageReference> resultList = null;
>         synchronized(dispatchMutex) {
>             //WHAT IS THIS DOING?
>             //int toPageIn = getMaxPageSize() + Math.max(0, (int)destinationStatistics.getInflight().getCount()) -pagedInMessages.size();
>             //DOES THIS MAKE MORE SENSE:
>             int toPageIn = Math.min(getMaxPageSize(), messages.size());
>             
>             if (LOG.isDebugEnabled()) {
>                 LOG.debug(destination.getPhysicalName() + " toPageIn: "  + toPageIn + ", Inflight: "
>                         + destinationStatistics.getInflight().getCount()
>                         + ", pagedInMessages.size " + pagedInMessages.size());
>             }
>             
>             //WHAT IS THIS DOING?
>             //toPageIn = Math.max(0, Math.min(toPageIn, getMaxPageSize()));
>                        
>             if (isLazyDispatch()&& !force) {
>                 // Only page in the minimum number of messages which can be dispatched immediately.
>                 toPageIn = Math.min(getConsumerMessageCountBeforeFull(), toPageIn);
>             }
>    
> {code}
> It is definitely possible that I'm just not understanding the intent of the code, but whatever it is, it's not working, and consequently I'm not sure that the subsequent fixes on the branch have eliminated the problem. The attached patch contains both a unit test, that tests several combinations of ack mode, vm cursoring, and delivery mode, as well as version of Queue which should be applied against revirion 818147 -- this version has the fix commented out and preserves the buggy behavior

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


[jira] Resolved: (AMQ-2413) Hangs possible because of Queue.doPageIn

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies resolved AMQ-2413.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 5.3.0

Patch looks good to me - applied in SVN 818762

> Hangs possible because of Queue.doPageIn
> ----------------------------------------
>
>                 Key: AMQ-2413
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2413
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.0
>         Environment: 5.4 branch 818147. Some changes after this hide this error, but I'm still concerned it might be a problem.
>            Reporter: Colin MacNaughton
>            Assignee: Rob Davies
>            Priority: Critical
>             Fix For: 5.3.0
>
>         Attachments: AMQ-2413patch.txt
>
>
> I don't understand the intent of the following code in Queue.doPageIn() and in rev 818147 it was causing delivery to the consumer to get hung (temporarily until message expiration check kickstarts it again). See the commented out lines of code that determine how many messages to attempt to page in. 
> {code}
>     private List<QueueMessageReference> doPageIn(boolean force) throws Exception {
>         List<QueueMessageReference> result = null;
>         List<QueueMessageReference> resultList = null;
>         synchronized(dispatchMutex) {
>             //WHAT IS THIS DOING?
>             //int toPageIn = getMaxPageSize() + Math.max(0, (int)destinationStatistics.getInflight().getCount()) -pagedInMessages.size();
>             //DOES THIS MAKE MORE SENSE:
>             int toPageIn = Math.min(getMaxPageSize(), messages.size());
>             
>             if (LOG.isDebugEnabled()) {
>                 LOG.debug(destination.getPhysicalName() + " toPageIn: "  + toPageIn + ", Inflight: "
>                         + destinationStatistics.getInflight().getCount()
>                         + ", pagedInMessages.size " + pagedInMessages.size());
>             }
>             
>             //WHAT IS THIS DOING?
>             //toPageIn = Math.max(0, Math.min(toPageIn, getMaxPageSize()));
>                        
>             if (isLazyDispatch()&& !force) {
>                 // Only page in the minimum number of messages which can be dispatched immediately.
>                 toPageIn = Math.min(getConsumerMessageCountBeforeFull(), toPageIn);
>             }
>    
> {code}
> It is definitely possible that I'm just not understanding the intent of the code, but whatever it is, it's not working, and consequently I'm not sure that the subsequent fixes on the branch have eliminated the problem. The attached patch contains both a unit test, that tests several combinations of ack mode, vm cursoring, and delivery mode, as well as version of Queue which should be applied against revirion 818147 -- this version has the fix commented out and preserves the buggy behavior

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


[jira] Assigned: (AMQ-2413) Hangs possible because of Queue.doPageIn

Posted by "Rob Davies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rob Davies reassigned AMQ-2413:
-------------------------------

    Assignee: Rob Davies

> Hangs possible because of Queue.doPageIn
> ----------------------------------------
>
>                 Key: AMQ-2413
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2413
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.0
>         Environment: 5.4 branch 818147. Some changes after this hide this error, but I'm still concerned it might be a problem.
>            Reporter: Colin MacNaughton
>            Assignee: Rob Davies
>            Priority: Critical
>         Attachments: AMQ-2413patch.txt
>
>
> I don't understand the intent of the following code in Queue.doPageIn() and in rev 818147 it was causing delivery to the consumer to get hung (temporarily until message expiration check kickstarts it again). See the commented out lines of code that determine how many messages to attempt to page in. 
> {code}
>     private List<QueueMessageReference> doPageIn(boolean force) throws Exception {
>         List<QueueMessageReference> result = null;
>         List<QueueMessageReference> resultList = null;
>         synchronized(dispatchMutex) {
>             //WHAT IS THIS DOING?
>             //int toPageIn = getMaxPageSize() + Math.max(0, (int)destinationStatistics.getInflight().getCount()) -pagedInMessages.size();
>             //DOES THIS MAKE MORE SENSE:
>             int toPageIn = Math.min(getMaxPageSize(), messages.size());
>             
>             if (LOG.isDebugEnabled()) {
>                 LOG.debug(destination.getPhysicalName() + " toPageIn: "  + toPageIn + ", Inflight: "
>                         + destinationStatistics.getInflight().getCount()
>                         + ", pagedInMessages.size " + pagedInMessages.size());
>             }
>             
>             //WHAT IS THIS DOING?
>             //toPageIn = Math.max(0, Math.min(toPageIn, getMaxPageSize()));
>                        
>             if (isLazyDispatch()&& !force) {
>                 // Only page in the minimum number of messages which can be dispatched immediately.
>                 toPageIn = Math.min(getConsumerMessageCountBeforeFull(), toPageIn);
>             }
>    
> {code}
> It is definitely possible that I'm just not understanding the intent of the code, but whatever it is, it's not working, and consequently I'm not sure that the subsequent fixes on the branch have eliminated the problem. The attached patch contains both a unit test, that tests several combinations of ack mode, vm cursoring, and delivery mode, as well as version of Queue which should be applied against revirion 818147 -- this version has the fix commented out and preserves the buggy behavior

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