You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Andy Goldstein (JIRA)" <ji...@apache.org> on 2011/06/03 17:27:47 UTC

[jira] [Created] (QPID-3291) Broker incorrectly sets TTL to 0 for messages about to expire

Broker incorrectly sets TTL to 0 for messages about to expire
-------------------------------------------------------------

                 Key: QPID-3291
                 URL: https://issues.apache.org/jira/browse/QPID-3291
             Project: Qpid
          Issue Type: Bug
          Components: C++ Broker
            Reporter: Andy Goldstein
         Attachments: QPID-3291.patch

When qpid::broker::Message::adjustTtl() is called prior to delivering a message to a peer, it adjusts the TTL down to reflect the time the message spent in the broker.  For a message that has expired, it sets the TTL to 1.  The current logic calculates the remaining TTL as the difference, in nanoseconds, between the current time and the expiration time.  If this value is greater than 0, it converts the remaining TTL to milliseconds and sets it on the message; otherwise, it sets the TTL to 1.

This logic could result in a message that is about to expire receiving a TTL of 0.  This would occur if the remaining TTL is somewhere between 1 and 1,000,000 ns.  When the division occurs to convert to ms, it would result in some number between 0 and 1, which is rounded down to 0.  Instead, this value should be 1.

To fix this, the remaining TTL should be compared against 1,000,000.  If it is >= to that number, then the conversion can proceed successfully; otherwise, the TTL should be set to 1.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] [Updated] (QPID-3291) Broker incorrectly sets TTL to 0 for messages about to expire

Posted by "Justin Ross (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Justin Ross updated QPID-3291:
------------------------------

    Fix Version/s: 0.12
    
> Broker incorrectly sets TTL to 0 for messages about to expire
> -------------------------------------------------------------
>
>                 Key: QPID-3291
>                 URL: https://issues.apache.org/jira/browse/QPID-3291
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>            Reporter: Andy Goldstein
>             Fix For: 0.12
>
>         Attachments: QPID-3291.patch
>
>
> When qpid::broker::Message::adjustTtl() is called prior to delivering a message to a peer, it adjusts the TTL down to reflect the time the message spent in the broker.  For a message that has expired, it sets the TTL to 1.  The current logic calculates the remaining TTL as the difference, in nanoseconds, between the current time and the expiration time.  If this value is greater than 0, it converts the remaining TTL to milliseconds and sets it on the message; otherwise, it sets the TTL to 1.
> This logic could result in a message that is about to expire receiving a TTL of 0.  This would occur if the remaining TTL is somewhere between 1 and 1,000,000 ns.  When the division occurs to convert to ms, it would result in some number between 0 and 1, which is rounded down to 0.  Instead, this value should be 1.
> To fix this, the remaining TTL should be compared against 1,000,000.  If it is >= to that number, then the conversion can proceed successfully; otherwise, the TTL should be set to 1.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (QPID-3291) Broker incorrectly sets TTL to 0 for messages about to expire

Posted by "Andy Goldstein (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Goldstein updated QPID-3291:
---------------------------------

    Attachment: QPID-3291.patch

Patch to correct TTL adjustment

> Broker incorrectly sets TTL to 0 for messages about to expire
> -------------------------------------------------------------
>
>                 Key: QPID-3291
>                 URL: https://issues.apache.org/jira/browse/QPID-3291
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>            Reporter: Andy Goldstein
>         Attachments: QPID-3291.patch
>
>
> When qpid::broker::Message::adjustTtl() is called prior to delivering a message to a peer, it adjusts the TTL down to reflect the time the message spent in the broker.  For a message that has expired, it sets the TTL to 1.  The current logic calculates the remaining TTL as the difference, in nanoseconds, between the current time and the expiration time.  If this value is greater than 0, it converts the remaining TTL to milliseconds and sets it on the message; otherwise, it sets the TTL to 1.
> This logic could result in a message that is about to expire receiving a TTL of 0.  This would occur if the remaining TTL is somewhere between 1 and 1,000,000 ns.  When the division occurs to convert to ms, it would result in some number between 0 and 1, which is rounded down to 0.  Instead, this value should be 1.
> To fix this, the remaining TTL should be compared against 1,000,000.  If it is >= to that number, then the conversion can proceed successfully; otherwise, the TTL should be set to 1.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] [Resolved] (QPID-3291) Broker incorrectly sets TTL to 0 for messages about to expire

Posted by "Gordon Sim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim resolved QPID-3291.
------------------------------

    Resolution: Fixed

> Broker incorrectly sets TTL to 0 for messages about to expire
> -------------------------------------------------------------
>
>                 Key: QPID-3291
>                 URL: https://issues.apache.org/jira/browse/QPID-3291
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>            Reporter: Andy Goldstein
>         Attachments: QPID-3291.patch
>
>
> When qpid::broker::Message::adjustTtl() is called prior to delivering a message to a peer, it adjusts the TTL down to reflect the time the message spent in the broker.  For a message that has expired, it sets the TTL to 1.  The current logic calculates the remaining TTL as the difference, in nanoseconds, between the current time and the expiration time.  If this value is greater than 0, it converts the remaining TTL to milliseconds and sets it on the message; otherwise, it sets the TTL to 1.
> This logic could result in a message that is about to expire receiving a TTL of 0.  This would occur if the remaining TTL is somewhere between 1 and 1,000,000 ns.  When the division occurs to convert to ms, it would result in some number between 0 and 1, which is rounded down to 0.  Instead, this value should be 1.
> To fix this, the remaining TTL should be compared against 1,000,000.  If it is >= to that number, then the conversion can proceed successfully; otherwise, the TTL should be set to 1.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org