Skip to content

Transition zoostore deferral tracking to use System.nanoTime #4068

@keith-turner

Description

@keith-turner

Describe the bug

When a FATE operation is unreserved with a deferral time, the code uses System.currentTimeMillis() to determine when the operation should run again. In the case where wall time changes on the machine this could cause this deferral tracking to be incorrect, in the worse case causing something to not run for long periods of time.

Expected behavior

If would be best if the deferral time tracking in ZooStore used System.nanoTime instead of System.currentTimeMillis as this avoids problems with wall time changing. We could also modify the method signature of

public void unreserve(long tid, long deferTime)

to

public void unreserve(long tid, long deferTime, TimeUnit deferTimeUnuit)

All the code that calls this method would still pass milliseconds, so making the time unit explicit would make the code less confusing if the ZooStore impl uses nano seconds and its routinely passed milliseconds.

Metadata

Metadata

Assignees

Labels

bugThis issue has been verified to be a bug.

Type

No type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions