Steps to reproduce
- Start an
Fbe.iterate or Fbe.conclude operation with a configured timeout or lifetime.
- While it is running, move the system clock forward or backward without changing the process monotonic clock.
- Let the operation reach the configured elapsed-time limit.
Actual result
Fbe.over? calculates elapsed time with Time.now - epoch and Time.now - kickoff. A forward clock adjustment can make the 90% cutoff fire early. A backward adjustment makes elapsed time smaller (or negative), so the graceful cutoff does not fire when the real elapsed budget is nearly spent. In the latter case, the outer Timeout.timeout in Judges::Update can terminate the judge at its hard deadline instead of allowing the code to stop at its documented 90% margin.
Expected result
Elapsed timeout and lifetime checks should use a monotonic clock, so system clock corrections do not change how much runtime remains.
Technical evidence
lib/fbe/over.rb compares Time.now - epoch and Time.now - kickoff against 90% of the configured budgets. Fbe::Conclude#roll and Fbe::Iterate#over rely on Fbe.over? to stop between items and reserve time for orderly completion. Wall-clock time can move independently of elapsed process time.
Steps to reproduce
Fbe.iterateorFbe.concludeoperation with a configured timeout or lifetime.Actual result
Fbe.over?calculates elapsed time withTime.now - epochandTime.now - kickoff. A forward clock adjustment can make the 90% cutoff fire early. A backward adjustment makes elapsed time smaller (or negative), so the graceful cutoff does not fire when the real elapsed budget is nearly spent. In the latter case, the outerTimeout.timeoutinJudges::Updatecan terminate the judge at its hard deadline instead of allowing the code to stop at its documented 90% margin.Expected result
Elapsed timeout and lifetime checks should use a monotonic clock, so system clock corrections do not change how much runtime remains.
Technical evidence
lib/fbe/over.rbcomparesTime.now - epochandTime.now - kickoffagainst 90% of the configured budgets.Fbe::Conclude#rollandFbe::Iterate#overrely onFbe.over?to stop between items and reserve time for orderly completion. Wall-clock time can move independently of elapsed process time.