Skip to content

Fix for console and file explorer timeout - #1065

Merged
javuto merged 1 commit into
developfrom
console-timeout-improvement
Sep 25, 2026
Merged

javuto merged 1 commit into
developfrom
console-timeout-improvement

Conversation

@javuto

@javuto javuto commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

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 from node.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 granted
  • Warmup command expired before the node's real next read → timeout

The refinement carried error ±interval, i.e. it had no reliable signal.

Changes

Backend (benefits console and file explorer)

  • cmd/api/handlers/console.go — warmupQueryWait no longer trusts the recorded read; it always reserves a full poll interval (capped by maxWarmupWait). 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.
  • Removed the now-unneeded per-submit node lookup (sessionNode) — one fewer DB query on every console command / file explorer submit.

Frontend (console only)

  • frontend/src/features/nodes/NodeConsolePage.tsx — SSE resource.changed events 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

  • No auth, permission, or route changes; handlers remain thin
  • Longer expirations only affect pending duration of hidden internal queries; results are still resolved via existing terminal-status handling
  • Dead nodes still fail fast: base timeout + bounded warmup wait (maxWarmupWait = 10m)

Validation

Check Result
go test ./... ✅ all pass
Frontend npm test ✅ 416/416
npm run check (tsc) ✅ clean
golangci-lint (changed pkgs) ✅ 0 issues
make openapi-check ✅ current

Regression Tests Added

  • console_test.go / file_explorer_test.go — stale last_query_read (overdue stamp) must not shrink the warmup window; expiration must cover a full interval
  • NodeConsolePage.test.tsx — a priming live-update event triggers a refetch of the priming command

@javuto javuto added 🚧 bugfix Fix for an existing bug 🖥️ console Console related issues 🗄️ file explorer File explorer related issues ⭐️ frontend Frontend related issues labels Sep 25, 2026
@javuto
javuto merged commit c13c71f into develop Sep 25, 2026
8 checks passed
@javuto
javuto deleted the console-timeout-improvement branch September 25, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚧 bugfix Fix for an existing bug 🖥️ console Console related issues 🗄️ file explorer File explorer related issues ⭐️ frontend Frontend related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant