Fixed a bug where timers wouldn't expire after `process:reinitialize`.

Pending `ticks` are used by `scheduleTick` to decide whether to schedule
an event loop tick when a new timer is scheduled - since we only need to
schedule the event loop tick if the new timer is supposed to expire
earlier than the current earliest timer.
Unfortunately `Clock::finalize` didn't clear `ticks`, which means that
the following could happen:
- schedule a timer T0 for expiration at time t0
- call `process::reinitalize`, which calls `Clock::finalize` but doesn't
  clear `ticks`
- schedule a new timer T1 for expiration at time t1 > t0: since
  `scheduleTick` would see that there was already the earlier pending
  tick for T0 in `ticks` with t0 < t1, it wouldn't actually schedule a
  tick of the event loop

Therefore new timers would never fire again.

This caused e.g.
`DockerContainerizerIPv6Test.ROOT_DOCKER_LaunchIPv6HostNetwork` test to
hang since it called `process::reinitialized` while having some active
timers - e.g. the reaper periodic timer.

Also added a test specifically for this bug.
2 files changed
tree: 0022340c750e403d8372b107c0c4df4c9e62d327
  1. .gitattributes
  2. 3rdparty/
  4. CMakeLists.txt
  5. Doxyfile
  10. bin/
  11. bootstrap
  12. cmake/
  14. docs/
  15. include/
  16. m4/
  18. site/
  19. src/
  20. support/

Apache Mesos

Apache Mesos is a cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks. It can run Hadoop, Jenkins, Spark, Aurora, and other frameworks on a dynamically shared pool of nodes.

Visit us at

Mailing Lists


Documentation is available in the docs/ directory. Additionally, a rendered HTML version can be found on the Mesos website's Documentation page.


Instructions are included on the Getting Started page.


Apache Mesos is licensed under the Apache License, Version 2.0.

For additional information, see the LICENSE and NOTICE files.