Skip to content

Fbe.over? uses wall-clock time for elapsed limits #1346

Description

@gemshrine

Steps to reproduce

  1. Start an Fbe.iterate or Fbe.conclude operation with a configured timeout or lifetime.
  2. While it is running, move the system clock forward or backward without changing the process monotonic clock.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions