Skip to content

Improve diagnostics for job data request timeouts - #655

Merged
liuwei08 merged 2 commits into
masterfrom
fix/job-load-diagnostics
Nov 19, 2026
Merged

liuwei08 merged 2 commits into
masterfrom
fix/job-load-diagnostics

Conversation

@liuwei08

@liuwei08 liuwei08 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Job startup can repeatedly time out on GET /api/job/job while the console only shows buffered ReadTimeout messages. Flush each attempt and failure traceback immediately, include request ID and elapsed time, and correlate them with API stage logs for database pool acquisition, token validation, OPA authorization, job queries, and Vault calls. Logging each stage before it starts identifies operations that never finish. The timeout test captures flushed output before retry and performs assertions after load_data returns, so its retry handler cannot swallow assertion failures.

This change also increases the bootstrap read timeout from 10 to 120 seconds and removes raw Vault tokens and authentication configuration from two existing log/error messages. Other retry and job-status handling stays unchanged.

Validation:

  • All 8 existing unit tests passed: immediate timeout reporting, request correlation, secret payload omission, API error handling, completed-job exit, and tracing scope.
  • Disabling traceback output or removing the final failure flush makes the existing timeout test fail as expected.
  • Python 3.9 syntax and whitespace checks passed.
  • Full API integration and injected DB/OPA failures were not covered. Both job and API images must be updated to use the correlated diagnostics.

The original console establishes a bootstrap API read timeout; it does not establish which backend operation caused it.

@liuwei08
liuwei08 merged commit b07d02b into master Nov 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant