Repository navigation
perf(submit): read report-form server names from the query cache - #1619
Closed
NopeCharon wants to merge 1 commit into
Closed
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
…p#1611) The public "Report a player" form labelled its server <select> by opening a fresh A2S socket to every enabled server on every render (Connect + GetInfo, 1s timeout each). On panels with 20+ servers the page took 5-10 seconds to load. Because the page is anonymous, every reload also fanned an uncached UDP probe out to every game server, the same amplification shape sbpp#1311 closed on the servers page. Read the hostnames through Sbpp\Servers\SourceQueryCache instead, the per-(ip, port) on-disk cache the public servers page already fills. A visitor coming from the servers list hits a warm cache, and repeat loads inside the 30s window issue no probes at all. Unreachable servers are negatively cached, so an offline server costs one timeout per window instead of one per page view. The submit path, which looks up the chosen server's name for the notification email, uses the same cache. SubmitBanServerListCacheTest renders page.submit.php against the cache's probe override: a warm cache is reused with zero probes, a cold cache probes each server once and a reload coalesces, and an unreachable server keeps the "Error Connecting (ip:port)" label. ARCHITECTURE.md and AGENTS.md list the form as a cache consumer.
|
Thanks for the PR! This change touches To sign, comment exactly the following line on this PR:
You only need to sign once — your signature applies to every future See I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Member
|
Spam bot |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
The public "Report a player" form (
page.submit.php) now gets server hostnames for its server<select>fromSbpp\Servers\SourceQueryCache. Before, it opened a fresh A2S socket to every enabled server on every render.That's the same per-
(ip, port)on-disk cache (30s window) the public servers page already fills:The submit path, which looks up the chosen server's name for the notification email, uses the same cache. I also updated the
SubmitBanViewdocblock, the cache section in ARCHITECTURE.md, and the matching AGENTS.md "Where to find what" row.Motivation and Context
Fixes #1611. With 20+ servers the form took 5-10 seconds to load.
Because the page is anonymous, every reload also fanned an uncached UDP probe out to every configured game server. #1311 removed that amplification from the servers page; this removes it from the report form.
One trade-off: on a fully cold cache, a reachable server now gets
GetInfo + GetPlayers(the cache's payload) instead ofGetInfoonly. That only happens once per window, and it warms the servers page too.How Has This Been Tested?
web/tests/integration/SubmitBanServerListCacheTest.php. It renderspage.submit.phpin a separate process against the cache's probe override and checks three cases:Error Connecting (ip:port)label.main, the first two tests fail and the third passes, as expected.php -S) with five servers on unreachable TEST-NET addresses and timedGET ?p=submit.main: 5.5s, 5.0s, 5.0s on every load.mainin my container. Two areExportBundleWriterTest(noext-zipin my image), and one was thePluginVersionResolveTestdescribe test fixed by Make PluginVersionResolveTest git-describe tests independent of checkout tag #1615.Types of changes
Checklist: