[ 
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-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to