Description
If you want to wreak havoc on a ZK based system just do [date -s "+1hour"] and watch the mayhem as all sessions expire at once.
This shouldn't happen. Zookeeper could easily know handle elapsed times as elapsed times rather than as differences between absolute times. The absolute times are subject to adjustment when the clock is set while a timer is not subject to this problem. In Java, System.currentTimeMillis() gives you absolute time while System.nanoTime() gives you time based on a timer from an arbitrary epoch.
I have done this and have been running tests now for some tens of minutes with no failures. I will set up a test machine to redo the build again on Ubuntu and post a patch here for discussion.
Attachments
Attachments
Issue Links
- is duplicated by
-
ZOOKEEPER-366 Session timeout detection can go wrong if the leader system time changes
- Resolved
-
ZOOKEEPER-1616 time calculations should use a monotonic clock
- Resolved
- is required by
-
ZOOKEEPER-2774 Ephemeral znode will not be removed when sesstion timeout, if the system time of ZooKeeper node changes unexpectedly.
- Resolved
- relates to
-
ZOOKEEPER-1626 Zookeeper C client should be tolerant of clock adjustments
- Resolved