fix(proxy): make CODE cold-start handling request-independent and status-driven#343
Open
joshtrichards wants to merge 4 commits into
Open
fix(proxy): make CODE cold-start handling request-independent and status-driven#343joshtrichards wants to merge 4 commits into
joshtrichards wants to merge 4 commits into
Conversation
3 tasks
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
Improve cold-start handling in
proxy.phpfor the built-in CODE server.Previously, startup was already launched in the background, but request handling could still wait indefinitely for readiness and cold-start progress was not tracked explicitly across requests. This made startup behavior harder to reason about during slow starts, repeated requests, or failure scenarios.
This change makes cold-start progress more request-independent and status-driven by:
?statushandling more robust during startupRelated changes in frontend, but not dependent on: nextcloud/richdocuments#5705
Changes
Startup coordination
coolwsd.startingmarker file in the temp directoryStartup lifecycle
startCoolwsd()to trigger startup and return quicklyStatus endpoint behavior
?statushandling more robust during cold startOK,starting,restarting, anderrorRequest-path behavior
Hardening
Why
This makes the proxy a better backend for clients that poll readiness during cold start, especially during first-run extraction or slower startup scenarios.
It also improves operational behavior by making startup:
User/admin impact
Users
Administrators
?statusbehavior during startupReview notes
Most of the code churn is due to extracting repeated cold-start checks into helpers.
I tried split this into small commits by concern:
The intended functional changes are mainly in 2–4; 1 provides the shared state mechanism.
Testing
Suggested manual verification:
proxy.php?statusOKonce ready?statusrequests during startup do not trigger duplicate launches