Title: refactor: compute service info request pacing from fresh clock reads by bdraco · Pull Request #1895 · python-zeroconf/python-zeroconf · GitHub
Open Graph Title: refactor: compute service info request pacing from fresh clock reads by bdraco · Pull Request #1895 · python-zeroconf/python-zeroconf
X Title: refactor: compute service info request pacing from fresh clock reads by bdraco · Pull Request #1895 · python-zeroconf/python-zeroconf
Description: Summary Restructures the ServiceInfo.async_request polling loop the same way #1888 restructured the registration probe loop: wait-first if/continue shape, a fresh clock read at the top of each cycle, and deadline arithmetic in place of the carried now/next_/last trio. This is the last structural item from the tenth audit's inventory (#1835). Details Behavior preserved: fail at the deadline or on denial; the first query goes out immediately (QU unless a question type is passed, later queries QM); each send schedules the next at delay plus random jitter; the QM duplicate question escalation stands; every wake from a record update re-checks completeness; the listener is always removed. Wait durations are computed from the current clock rather than a value cached before the previous send, so queries land on schedule instead of accumulating per-cycle lag. The loop now reads the same way as async_check_service without being coupled to it. A shared pacing primitive was considered and rejected: the two loops differ in termination (probe count vs deadline/completion), cadence (fixed schedule vs adaptive jitter) and wake condition (engine notify vs the info's own futures), so extraction would be a callback-shaped abstraction bigger than the three lines it saves, with bound-method indirection in a Cythonized module. Perf: one extra current_time_millis() call per query sent, in a loop whose iterations are separated by 25 to 1000 ms waits; no per-packet or per-record path changed and nothing in info.pxd is touched. Test plan full compiled test suite after REQUIRE_CYTHON=1 rebuild: 518 passed pre-commit clean four-agent simplify review: reuse, efficiency and altitude clean; the flatter loop shape it proposed was declined since it is the 2009 statement sequence this change retires
Open Graph Description: Summary Restructures the ServiceInfo.async_request polling loop the same way #1888 restructured the registration probe loop: wait-first if/continue shape, a fresh clock read at the top of each cycl...
X Description: Summary Restructures the ServiceInfo.async_request polling loop the same way #1888 restructured the registration probe loop: wait-first if/continue shape, a fresh clock read at the top of each cycl...
Opengraph URL: https://github.com/python-zeroconf/python-zeroconf/pull/1895
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2939ae9b-206f-f6f7-5a78-4953ec3c259f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A486:58BB1:181D6B:219E46:6B00831E |
| html-safe-nonce | 1e45e8026523b601eabca7d9d52e76ca1156a027edaaa2826ff1bc7f7eb2c53c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDg2OjU4QkIxOjE4MUQ2QjoyMTlFNDY6NkIwMDgzMUUiLCJ2aXNpdG9yX2lkIjoiMzgyNjgzNDI4Nzk0MDg5NTUxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d6485fedb834fcc35846dddb07c3cb127d98477268194bc3c12e8b72d005e052 |
| hovercard-subject-tag | pull_request:4394312459 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python-zeroconf/python-zeroconf/pull/1895/files |
| twitter:image | https://avatars.githubusercontent.com/u/663432?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/663432?s=400&v=4 |
| og:image:alt | Summary Restructures the ServiceInfo.async_request polling loop the same way #1888 restructured the registration probe loop: wait-first if/continue shape, a fresh clock read at the top of each cycl... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4d3d8e50f02c1d7bf86d5acfa1d3bfe9366abd6528a6b429eb07a168429d2b61 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python-zeroconf/python-zeroconf git https://github.com/python-zeroconf/python-zeroconf.git |
| octolytics-dimension-user_id | 120192235 |
| octolytics-dimension-user_login | python-zeroconf |
| octolytics-dimension-repository_id | 21548731 |
| octolytics-dimension-repository_nwo | python-zeroconf/python-zeroconf |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21548731 |
| octolytics-dimension-repository_network_root_nwo | python-zeroconf/python-zeroconf |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db758f8e02b8257935fb03edf81a3e76eb3abd11 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width