fix(api): timeout on startup on 7.0 and 6.12#1844
Conversation
Updated the total startup budget, bootstrap reserved time, and maximum operation timeout values to enhance API startup reliability. The total startup budget is now set to 30 seconds, with 20 seconds reserved for bootstrap and a maximum operation timeout of 5 seconds.
|
Caution Review failedThe pull request is closed. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThis pull request extends application startup and bootstrap timeout constants in both PM2 configuration and the application's index file, allowing the app more time to initialize before triggering timeout errors. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // PM2 listen_timeout is 15 seconds (ecosystem.config.json) | ||
| // We use 13 seconds as our total budget to ensure our timeout triggers before PM2 kills us | ||
| const TOTAL_STARTUP_BUDGET_MS = 13_000; | ||
| const TOTAL_STARTUP_BUDGET_MS = 30_000; |
There was a problem hiding this comment.
Keep startup budget under PM2 listen_timeout
The new TOTAL_STARTUP_BUDGET_MS of 30s now exceeds the PM2 listen_timeout of 15s in api/ecosystem.config.json (line 10), so the TimeoutBudget can authorize operations and a bootstrap window that run well past the supervisor’s kill threshold. In environments where startup legitimately takes >15s, PM2 will restart the process before our 30s budget expires, causing repeated startup failures instead of graceful timeouts, contrary to the intent documented in the comment on these lines.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1844 +/- ##
=======================================
Coverage 52.89% 52.89%
=======================================
Files 868 868
Lines 50051 50051
Branches 5079 5079
=======================================
Hits 26473 26473
Misses 23503 23503
Partials 75 75 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Increased the listen timeout from 15 seconds to 30 seconds in the ecosystem configuration to enhance the API's startup reliability.
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
🤖 I have created a release *beep* *boop* --- ## [4.28.2](v4.28.1...v4.28.2) (2025-12-16) ### Bug Fixes * **api:** timeout on startup on 7.0 and 6.12 ([#1844](#1844)) ([e243ae8](e243ae8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Updated the total startup budget, bootstrap reserved time, and maximum operation timeout values to enhance API startup reliability. The total startup budget is now set to 30 seconds, with 20 seconds reserved for bootstrap and a maximum operation timeout of 5 seconds.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.