refactor: compute probe pacing from fresh clock reads - #1888
Conversation
|
Thanks for contributing! A quick note: this project is in the process of moving from LGPL-2.1 to Apache 2.0, see #1835. By continuing with this pull request you agree that this new contribution is offered under Apache 2.0. This notice does not affect your previous contributions. If you would like to consent to relicensing those as well, please post the consent statement on #1835; silence is never treated as consent for past work. If offering this contribution under Apache 2.0 does not work for you, no hard feelings; reply with the exact phrase |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1888 +/- ##
=======================================
Coverage 99.87% 99.87%
=======================================
Files 33 33
Lines 3910 3911 +1
Branches 568 568
=======================================
+ Hits 3905 3906 +1
Misses 3 3
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Rework the probe pacing loop in
async_check_serviceso the wait arithmetic uses fresh clock reads. The old loop reused anowcached before the previous send, so each probe went out late by the time spent sending, and the counter reset dance acrossi/now/next_timewas hard to follow.Details
_CHECK_TIMEapart on an absolute schedule (next_probe_at += _CHECK_TIME), matching the RFC 6762 section 8.1 probe interval; the wait is now computed against the current clock, so sends land on schedule instead of accumulating per-iteration lag.NonUniqueNameExceptionor renames and restarts probing from zero, and every wake fromasync_wait(which record updates notify) re-checks for a conflict before waiting again.whileis flattened to anif/continuesince the outer loop re-runs the check anyway.Test plan
REQUIRE_CYTHON=1rebuild): 516 passed