[jbossts-issues] [JBoss JIRA] (JBTM-2266) TransactionReaper is using currentTimeMillis for timeout calculation

Mark Little (JIRA) issues at jboss.org
Wed Oct 1 16:21:02 EDT 2014

    [ https://issues.jboss.org/browse/JBTM-2266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007844#comment-13007844 ] 

Mark Little commented on JBTM-2266:

I'm not sure this really needs to be changed. This isn't a hard realtime deadline. The standards (JTA, OTS/JTS) don't require the timeout to kick in *exactly* on time. So some skew is fine. As a result I wouldn't even classify the current implementation as a bug.

> TransactionReaper is using currentTimeMillis for timeout calculation
> --------------------------------------------------------------------
>                 Key: JBTM-2266
>                 URL: https://issues.jboss.org/browse/JBTM-2266
>             Project: JBoss Transaction Manager
>          Issue Type: Bug
>    Affects Versions: 5.0.3
>            Reporter: David Lloyd
>            Assignee: Tom Jenkinson
>            Priority: Minor
> Noticed while browsing through some code that the TransactionReaper uses currentTimeMillis() to calculate timeouts.  However the timestamp reported by this method can change in an unexpected way if the system clock is changed.
> An artificial clock based on System.nanoTime() should be used instead, since while this time may vary slightly between cores, in general it will be highly accurate and, most importantly, monotonic and steady (and unaffected by changes to the system time).

This message was sent by Atlassian JIRA

More information about the jbossts-issues mailing list