Repository navigation
Server: limit the number of titles in the score store - #165
Merged
Merged
Conversation
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.
Why
The in-memory score store limited the boards of one title (1000) and the players of one board (10000), but not the number of titles, so its size had no bound across titles.
docs/running.mdsaid so ("the number of titles is not limited").Change
server/store/memory.go: the store keeps boards for at most 1000 titles (maxTitles). APutthat would start a board for a new title past that returnsErrFull, which the server already answers with ERROR 6 and a debug log line; the refusal creates nothing. A title that already has boards still takes new boards (up to its own limit), new players and better scores, and a player already on a board is never refused.server/store/store.go: theErrFullmessage and thePutcomment name the title limit.docs/api.md,docs/running.mdanddocs/integrating.md: the limits text now lists the title limit; the sentence that the number of titles is not limited is removed. CHANGELOG Server: entry under Fixed;site/regenerated.Tests
server/store/memory_limit_test.go: the default is 1000 titles, 1000 boards per title and 10000 players per board; with a limit of 2, a third title is refused and leaves no title, board or entry behind, while an existing title still takes a new board, a new player and a better score; the limit counts titles, not boards.gofmt,go vet,go test ./server/...,python3 tools/repo_check.py,python3 tools/site.py --check,python3 tools/features.py --checkandscripts/check-deploy.shpass.mainthe new test does not build, becausemaxTitlesdoes not exist there.Not in this change
No flag, no change to the other two limits, no persistent store, and no change to how the server answers a refused score.
Overlap
None open on
server/store. Other open work touchesCHANGELOG.mdand the generated site files, so whichever merges later needs a rebase. Based on main at 7fdd762.Developed with AI agent assistance.