Change /_publish-realm to be async#5325
Draft
backspace wants to merge 3 commits into
Draft
Conversation
Contributor
Preview deploymentsHost Test Results 1 files ± 0 1 suites ±0 1h 43m 27s ⏱️ -1s Results for commit 3314869. ± Comparison against earlier commit f112c6b. For more details on these errors, see this check. Realm Server Test Results 1 files ± 0 1 suites ±0 8m 24s ⏱️ - 2m 46s Results for commit 3314869. ± Comparison against earlier commit f112c6b. For more details on these errors, see this check. |
The async publish handler returned 202 without mounting the published realm on this instance, relying on lazy-mount-on-request to serve it. That left freshly-published realms 404ing until something mounted them, which lazy-mount did not reliably do on the publishing instance. Mount the realm via reconciler.lookupOrMount without awaiting it: ensureMounted publishes the realm into virtualNetwork synchronously, so it is served as soon as the 202 returns, while start()'s from-scratch index runs in the background and clients poll _readiness-check. For a republish (already mounted) the follow-up kicks fullIndex to reindex the swapped files. Tests: index-responses reconciles before the readiness check; the host publish command test stubs waitForRealmReady at the service level (its network mock could not match subdirectory readiness pollers). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The caller can use
/_readiness-checkto see when indexing is complete.Also, publishing has been indexing twice … TBC