-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actually remove dungeon sessions #862
Merged
Merged
Conversation
This file contains 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
Speculative fix for random auto-repeat glitches throwing up stale data, and something we should be doing anyway. Today, when you finish a dungeon, the session remains in the cache for the remainder of its expiry time, because issues were previously encountered with the client retrying record requests after the session had been evicted. Now that the codebase makes better use of CancellationToken, this is much less likely if we put the eviction of the session right at the end of the response method. It is still possible if the request is cancelled during serialization, however. If we encounter issues we can make the RemoveDungeon method instead mark the session to be removed in 1 minute's time or similar. Also includes a refactoring of the DungeonService to implement a unit-of-work pattern, where the current session can be cached and modified in-memory without round-trips to the cache. This is primarily aimed at the DungeonStart logic which can require several updates after creating the session, arising from how the code is structured. Finally, makes sessions keyed by viewer ID, so that it isn't possible to get another player's session. It probably wasn't really possible before, given the astronomical likelihood of guessing/colliding GUIDs, but it makes sense to segregate this data by tenant all the same. **This key change is breaking, and the server should be taken down during the deployment.**
Apparently #861 fixed a lot of the reported issues with auto-repeat, to my surprise. This change still makes sense though as it will clean up the cache and remove some automapper usage in the dungeon code |
SapiensAnatis
added a commit
that referenced
this pull request
Jun 30, 2024
Today, when you finish a dungeon, the session remains in the cache for the remainder of its expiry time, because issues were previously encountered with the client retrying record requests if they take too long, and then encountering errors because the session had been deleted on the first request. Now that the codebase makes better use of CancellationToken, this is much less likely if we put the eviction of the session right at the end of the response method. It is still possible if the request is cancelled during serialization, however. If we encounter issues we can make the RemoveDungeon method instead mark the session to be removed in 1 minute's time or similar. Also includes a refactoring of the DungeonService to implement a unit-of-work pattern, where the current session can be cached and modified in-memory without round-trips to the cache. This is primarily aimed at the DungeonStart logic which can require several updates after creating the session, arising from how the code is structured. Finally, makes sessions keyed by viewer ID, so that it isn't possible to get another player's session. It probably wasn't really possible before, given the astronomical likelihood of guessing/colliding GUIDs, but it makes sense to segregate this data by tenant all the same. **This key change is breaking, and the server should be taken down during the deployment.**
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.
Speculative fix for random auto-repeat glitches throwing up stale data, and something we should be doing anyway.Today, when you finish a dungeon, the session remains in the cache for the remainder of its expiry time, because issues were previously encountered with the client retrying record requests if they take too long, and then encountering errors because the session had been deleted on the first request.
Now that the codebase makes better use of CancellationToken, this is much less likely if we put the eviction of the session right at the end of the response method. It is still possible if the request is cancelled during serialization, however. If we encounter issues we can make the RemoveDungeon method instead mark the session to be removed in 1 minute's time or similar.
Also includes a refactoring of the DungeonService to implement a unit-of-work pattern, where the current session can be cached and modified in-memory without round-trips to the cache. This is primarily aimed at the DungeonStart logic which can require several updates after creating the session, arising from how the code is structured.
Finally, makes sessions keyed by viewer ID, so that it isn't possible to get another player's session. It probably wasn't really possible before, given the astronomical likelihood of guessing/colliding GUIDs, but it makes sense to segregate this data by tenant all the same. This key change is breaking, and the server should be taken down during the deployment.