Fix for console and file explorer timeout - #1065
Merged
Merged
Conversation
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.
Console & File Explorer Timeout Fix
Problem Statement
Console commands (and file explorer requests) submitted while a node was still "warming up" its accelerated polling could expire undelivered, forcing operators to retry until acceleration happened to kick in.
Root Cause
warmupQueryWait(shared by both console and file explorer) predicted the node's next poll fromnode.LastQueryRead. That column is stamped by osctrl-tls's batch writer, which coalesces check-ins and flushes on--writer-timeout(default 60s — the same magnitude as the default 60s poll interval).A stamp lagging one flush cycle made a live, mid-cycle node look "overdue":
wait <= 0→ zero extra wait grantedThe refinement carried error ±interval, i.e. it had no reliable signal.
Changes
Backend (benefits console and file explorer)
cmd/api/handlers/console.go—warmupQueryWaitno longer trusts the recorded read; it always reserves a full poll interval (capped bymaxWarmupWait). Delivery is guaranteed for live nodes; once acceleration is active, commands complete on the first fast poll, so the extra expiration only bounds how long a dead node's command stays pending.cmd/api/handlers/file_explorer.go— same helper, so list/stat/priming get identical protection.sessionNode) — one fewer DB query on every console command / file explorer submit.Frontend (console only)
frontend/src/features/nodes/NodeConsolePage.tsx— SSEresource.changedevents now also invalidate the priming poll (its query key was previously missed), so the "warming" badge and header metadata resolve immediately when the node answers instead of lagging a reconcile interval.Security / Operational Impact
maxWarmupWait = 10m)Validation
go test ./...npm testnpm run check(tsc)golangci-lint(changed pkgs)make openapi-checkRegression Tests Added
console_test.go/file_explorer_test.go— stalelast_query_read(overdue stamp) must not shrink the warmup window; expiration must cover a full intervalNodeConsolePage.test.tsx— a priming live-update event triggers a refetch of the priming command