Repository navigation
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.
What
When the session table is full,
internal/udpserver/server_session.gologs the request domain on every rejected request:decision.RequestNameis the QNAME from the wire.Why it matters
<red>/<cyan>tags for colour. A domain containing</cyan>or<script>breaks that parsing for the rest of the line.logInvalidSessionDroppath already throttles and gates on debug logging; this one does neither.Change
Add
logField()inserver_utils.go: drops control characters (including ANSI escapes), replaces<>with[]so the colour tags survive, and caps the field at 120 chars so one request cannot dump a quarter kilobyte into the log. Apply it at the single call site.Testing
go build ./internal/udpserver/— not run here, no Go toolchain in my environment. The change is a pure string transform plus one call site; no signature or behaviour change beyond the logged text.I did not add throttling because that is a policy decision (what interval, whether to keep counting dropped requests while suppressed). Happy to add it following the
invalidSessionDropLogpattern if you want it in this PR.