Conversation
Port the socket-level fix from NovaSky-AI#2163 directly onto main. Keep idle SDK connections alive across long completion bursts and queue pending connections in the kernel instead of refusing them.
Contributor
Author
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Uvicorn server configuration in skyrl/tinker/api.py to better handle connection bursts. It introduces a HTTP_KEEP_ALIVE_TIMEOUT_SECONDS constant set to 75 seconds to prevent idle SDK connections from closing during busy event loop periods, and configures uvicorn.run with this keep-alive timeout and a custom connection backlog limit (SKYRL_HTTP_CONNECTION_LIMIT). There are no review comments, so I have no feedback to provide.
Contributor
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.
Summary
heartbeat_countexact by applying the number of waiting requests for that session.Why
At 128 concurrent LoRA training jobs, every heartbeat previously acquired the global SQLite write lock and committed independently. The queue then exceeded the 300-second stale-session window even though inference was still progressing, which evicted live sessions. Batching only the simultaneous heartbeat wave removes that write-amplification bottleneck without weakening liveness accounting. The socket settings provide headroom for the same completion/heartbeat bursts at the HTTP layer.
Validation
uv run --extra dev --extra tinker pytest tests/tinker/test_external_future_store.py -q: 13 passed.skyrl/tinker/api.py.us-central1-docker.pkg.dev/useful-memory-477923-v7/skyrl/megatron:skyrl-pr2177-c6be3fc3@sha256:0edbd53d5032c443b82c527340e1d87ad27180b91bf1c815758825d2f38e8fb7.c6be3fc3c693f76e42940eb716c2f008fa615b76and the image digest above.Trajectory workload integration: https://github.com/Trajectorylabs/trajectory/pull/4945