Project: mesos
Issue MESOS-3882: Libprocess: Implement process::Clock::finalize
Tracks this [TODO|https://github.com/apache/mesos/blob/aa0cd7ed4edf1184cbc592b5caa2429a8373e813/3rdparty/libprocess/src/process.cpp#L974-L975]. The {{Clock}} is initialized with a callback that, among other things, will dereference the global {{process_manager}} object. When libprocess is shutting down, the {{process_manager}} is cleaned up. Between cleanup and termination of libprocess, there is some chance that a {{Timer}} will time out and result in dereferencing {{process_manager}}. *Proposal* * Implement {{Clock::finalize}}. This would clear: ** existing timers ** process-specific clocks ** ticks * Change {{process::finalize}}. *# Resume the clock. (The clock is only paused during some tests.) When the clock is not paused, the callback does not dereference {{process_manager}}. *# Clean up {{process_manager}}. This terminates all the processes that would potentially interact with {{Clock}}. *# Call {{Clock::finalize}}.
Story points: 3