Fix when the Timekeeper is destroyed with in-flight delays
Summary: [Folly] Fix when the Timekeeper is destroyed with in-flight delays. Previously, the Timekeeper dtor would immediately trigger the delayed callbacks early with a success result. But there are various situations where that is wrong behavior, such as when the callback enqueues more delayed callbacks in the success path. Higher-level, a future returned by `Timekeeper::after` or `sleep` would be completed early with a value. Now, let it immediately trigger the delayed callbacks early with an error result. Higher-level, a future returned by `Timekeeper::after` or `sleep` will be completed early with an error. Also: use `NoTimeout` consistently, and, on interrupt, pass the interrupt exception through. Differential Revision: D6837669 fbshipit-source-id: 7d18d7f57999d56bbb5269cacdb443ac22448cf0
Showing
Please register or sign in to comment