From e11d98d2efa597b3163314ab475d4f073aa9ddf0 Mon Sep 17 00:00:00 2001 From: Songstats Audit Date: Sat, 29 Aug 2026 22:21:12 +0200 Subject: [PATCH] Use a monotonic clock for exit polling --- lib/childprocess/abstract_process.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/childprocess/abstract_process.rb b/lib/childprocess/abstract_process.rb index 93fd064..3a711f2 100644 --- a/lib/childprocess/abstract_process.rb +++ b/lib/childprocess/abstract_process.rb @@ -152,8 +152,8 @@ def crashed? def poll_for_exit(timeout) log "polling #{timeout} seconds for exit" - end_time = Time.now + timeout - until (ok = exited?) || Time.now > end_time + end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) + timeout + until (ok = exited?) || Process.clock_gettime(Process::CLOCK_MONOTONIC) > end_time sleep POLL_INTERVAL end