fix: unblock registration start event loop and restore long POST client#27
Open
hexxyan wants to merge 1 commit into
Open
fix: unblock registration start event loop and restore long POST client#27hexxyan wants to merge 1 commit into
hexxyan wants to merge 1 commit into
Conversation
POST /jobs ran start_registration synchronously inside an async FastAPI handler, freezing the sidecar event loop so concurrent /sessions and /stop missed the 750ms poll budget and surfaced as admin 502s. Offload start/resume/reclaim/device-login to asyncio.to_thread. Also re-wire sharedRegistrationLongHTTP into client.HTTPLong (field existed but was accidentally dropped from registrationClient construction).
Owner
|
谢谢佬的提交,晚点更新新版本,合并 |
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
start_registration/ resume / reclaim / device login) from the FastAPI async event loop viaasyncio.to_thread, so concurrent/sessionsand/stopkeep answering while start is slow.sharedRegistrationLongHTTPintoregistrationClient().HTTPLong. TheHTTPLongfield already existed on the client, but construction dropped it after an admin/shell merge, so long POST/jobsstill used the 750ms poll client and returned admin 502timeout awaiting response headers.Context / why not #22
PR #22 fixed the read path (bounded
/sessionslist, cache, prune). This PR fixes the write path: start blocked the sidecar event loop, and Go's long POST timeout wiring was missing in practice.Test plan
/jobswas in-flight,/health/sessions/stopreturned 200 within ~200ms (previously all timed out).POST /admin/api/accounts/register-emailreturned 200 instead of 502 under the same config.