fix(rivetkit): retry serverless pool configuration#4887
fix(rivetkit): retry serverless pool configuration#4887NathanFlurry wants to merge 1 commit intomainfrom
Conversation
|
🚅 Deployed to the rivet-pr-4887 environment in rivet-frontend
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Code ReviewOverviewThis PR fixes serverless pool configuration by:
IssuesFirst HTTP response is blocked for up to 30 seconds On the first cold start, if pool configuration is slow or requires all 30 retries, the first HTTP response is withheld for up to 30 seconds. The response is gated behind Programmer errors are retried unnecessarily
Log field format deviates from project convention The new code uses SuggestionsConsider exponential backoff instead of fixed interval 30 retries x 1s = fixed 30s total. For transient network failures, exponential backoff with jitter reduces load on the engine during restarts and is a better fit than a fixed polling interval. Document why response is blocked on pool configuration The behavioral shift from fire-and-forget to awaited is not explained. A brief comment at the await site explaining the invariant (e.g. "ensure this instance is registered in the pool before serving traffic") would prevent future regressions. After final failure, handler throws on every subsequent request Once all 30 attempts are exhausted and the promise rejects, SummaryThe retry logic itself is a good addition — the original code silently swallowed pool configuration errors. The main concern is the first-request latency impact from awaiting pool configuration before returning the response, combined with programmer errors being retried 30 times. Addressing the fast-fail path for config errors and documenting the blocking intent would resolve the key issues. |

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: