seastar icon indicating copy to clipboard operation
seastar copied to clipboard

Update lowres_clock when reactor stall is detected

Open Lazin opened this issue 1 year ago • 0 comments

Currently, when reactor is blocked the counters for lowres_clock and lowres_system_clock are not updated. Because of that, right after the reactor stall the lowres_clock::now() method can return stale value. The difference between the actual clock and the stale one depends on the duration of the reactor stall.

This may cause problems in the following scenario:

  stall_reactor_for_1s();
  auto deadline = lowres_clock::now() + 100ms;
  co_await some_io_operation(deadline);

The last line throws timed_out_error exception because internally it compares the deadline parameter with lowres_clock::now() which jumps 1s forward after a scheduling point.

This PR fixes the problem by refreshing the counters when the stall is actually detected.

Lazin avatar Mar 20 '23 18:03 Lazin