Repository navigation
Conversation
Each sync replaces the one in flight. A Save (an autosave, or a caller saving after a purchase) made while SaveAndCloseSession was writing cancelled the close; the close then failed, the DataStore was torn down, which cancelled that save too, so neither wrote and the session lock stayed until another server took it over. While a close is in flight, another close now shares it and any other sync is cancelled (an empty rejection, like a maid cancel) instead of replacing it, so a caller such as a receipt handler sees the save fail rather than a success that never wrote. Once the close settles, syncs work as before.
Deploy Resultsℹ️ No changed packages with deploy targets were discovered for this PR. · View logs Test Results
6 packages tested, 6 passed, 0 failed in 37.5s · View logs |
This branch was successfully deployed
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.
DataStore._doDataSyncreplaces_saveMaidon every sync, so each sync cancels the one in flight. If anything callsSave()(the autosave loop, or a caller saving after a purchase) whileSaveAndCloseSession()is writing:PlayerDataStoreManager's removal sees the close fail and destroys the DataStore;Neither writes, and the session lock stays until another server takes it over (the player's next join waits on the lock retries).
While a close is in flight,
_syncDatanow:A caller such as a receipt handler therefore sees its save fail (and can answer
NotProcessedYet) instead of a success that never wrote. Once the close settles, syncs work as before.Tests in
DataStore.GracefulClose.spec.lua: a save during the close doesn't cancel it (fails without this change), a second close shares the first, and saving works again after the close.