Repository navigation
Conversation
PromiseDataStore for a player being removed waited for the removal and then created a new DataStore for them. A call made during a leave, kick or shutdown therefore loaded and session locked a departed player's data on this server, warned "Called GetDataStore while player is removing", and kept the lock until another server asked for it. Players are now marked when they leave, are kicked or the server closes, and requests made with that Player are cancelled once the removal finishes. A rejoin (a new Player), requests by userId and RemovePlayerDataStore on a player who stays still reopen as before.
Test Results
6 packages tested, 4 passed, 2 failed in 38.8s · View logs Deploy Resultsℹ️ No changed packages with deploy targets were discovered for this PR. · View logs |
…emoval finished A request that arrived just after the leave's save finished skipped the wait and opened a new datastore for the player anyway.
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.
When something calls
PromiseDataStore(player)while that player's data is being removed (they left, were kicked, or the server is closing),PlayerDataStoreManagerwarnedCalled GetDataStore while player is removing, waited for the save, and then created a newDataStorefor a player who was gone. That's an extra load per leave, and the new store takes the session lock, which this server holds until another server asks for it (and at shutdown it outlives the server, so the player's next join waits on the lock retries).Players, is cancelled with an empty rejection, which isn't reported as uncaught.GetDataStoreisn't called while a removal runs, so the warning no longer fires for requests that wait.RemovePlayerDataStoreon a player who stays, which all still wait and reopen.Tests cover the reset case, a player who left during the removal, and a userId request after a leave. The same change runs in a live game, checked with a two-player local server and a live log.