perf(core): Don't use a LocalEndpoint to send the config#296
Merged
Conversation
This fixes an unintended side-effect of implementing "/get-coco-config" as a cocod `LocalEndpoint`. Like "real" endpoints, when there's a hit on this cocod `LocalEndpoint`: * the "get-coco-config" request is appended to the request queue in redis by Sanic * (eventually) the request is popped off the `queue` by the qworker * the qworker responds by writing the coco config as the response back to redis * Once it appears, the Sanic worker pulls the response out of redis and sends it back to the client. The unintended problem here is serializing the config request with all other coco requests. Because the client calls this endpoint whenever it starts up, the net effect is: the client is forced to wait for _everything_ already existing in the queue to be handled before it can finish intialising. If the `cocod` queue happens to be super deep, the client might time-out before Sanic responds with the config. However, it's not necessary to involve the queue or the qworker at all here, because the coco config is fully sanitized before Sanic starts up. The Sanic process has the same config as the qworker process. So, this PR replaces the old "get-coco-config" `LocalConfig` with a simple `/config` Sanic route which responds immediately with the coco config (as a standard JSON response, without the coco `Result` framework.) This should significantly speed-up client start-up in cases where the queue is congested.
Contributor
|
Ah! I wonder if this was related to some issues we've had at outriggers. |
ljgray
approved these changes
Jul 15, 2026
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.
This fixes an unintended side-effect of implementing "/get-coco-config" as a cocod
LocalEndpoint.Like "real" endpoints, when there's a hit on this cocod
LocalEndpoint:queueby the qworkerThe unintended problem here is serializing the config request with all other coco requests. Because the client calls this endpoint whenever it starts up, the net effect is: the client is forced to wait for everything already existing in the queue to be handled before it can finish intialising. If the
cocodqueue happens to be super deep, the client might time-out before Sanic responds with the config.However, it's not necessary to involve the queue or the qworker at all here, because the coco config is fully sanitized before Sanic starts up. The Sanic process has the same config as the qworker process.
So, this PR replaces the old "get-coco-config"
LocalEndpointwith a simple/configSanic route which responds immediately with the coco config (as a standard JSON response, without the cocoResultframework.)This should significantly speed-up client start-up in cases where the queue is congested.