Repository navigation
feat(hosts): log slow host ops before they time out - #575
Merged
Merged
Conversation
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the next macOS host-op timeout diagnosable from the log alone.
#574's macOS Verify failed once with
HostOpError: This machine did not answer validateCwd in time(lib/hosts/hub.ts:1090), and a second macOS failure's error text is not publicly readable. A local investigation could not reproduce the timeout — even the full suite under a 1-CPU constraint passed — and ruled out the obvious causes. The one thing the investigation kept hitting: a 30 s op timeout today leaves no trace of how slow the op was or where it stalled.This adds a slow-op warning to the hub's
request(): when a host op goes unanswered pastlinkTimings.slowOpWarnMs(10 s by default), it logs oneconsole.warnnaming the host label, the op, and the elapsed milliseconds, e.g.[omp-web] This machine has not answered validateCwd after 10000ms. The warning changes nothing about the op — no timeout, retry, or failure behaviour is touched, and ops whose deadline is shorter than the warning (e.g. the 5 s session search) never warn. The timer is cleared on settle, on failure, and on send failure, and isunref'd like the op deadline itself.The threshold lives on the exported
linkTimingsobject alongsideopTimeoutMs, so tests shorten it the same way.Verification
lib/hosts/hub.test.mjs: a slow op logs exactly one warning naming the host and op and then still times out with 504; an op answered before the threshold logs no warning.lib/hosts/hub.test.mjs: 95 pass / 0 fail, 3 runs.session-index,link-protocol,link-integration,daemon-links,hub-v7,maintenance-hub): 183 pass / 0 fail.npx tsc --noEmitclean;npx eslintclean on both touched files.References #574 and #569.
Summary by CodeRabbit