Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901789

Rework exception/timeout handling scheme: faster failure paths

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
      jmh

      Description

      There are several facets to the problem:

       a) If the benchmark is throwing the exception, we still unconditionally sleep for the iteration time; we should instead ask all threads to stop, and throw the exception early;

       b) If some benchmark thread does not cooperate with the regular protocol -- e.g. checking the "isDone" flag, which requires exiting from @Benchmark, we can try to interrupt it. This is where timeout mechanics comes in: we would start issuing interrupts after the timeout exceeds.

       c) With (b), there is an interesting corner case: if some benchmark thread had failed, and another one should have rendezvoused with it to exit its own @Benchmark, then we would wait for timeout to expire to kill the workload. But if one thread is failing, then benchmark score is irrelevant, and we might as well start interrupting without waiting for the timeout.

        Attachments

          Activity

            People

            • Assignee:
              shade Aleksey Shipilev
              Reporter:
              shade Aleksey Shipilev
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: