Repository navigation
FP-6: bounded S3 queue that never blocks polling; string policy for tenant/network strings - #308
Open
randomizedcoder wants to merge 6 commits into
Open
randomizedcoder wants to merge 6 commits into
randomizedcoder wants to merge 6 commits into
Conversation
pkg/strpolicy.Clean cuts a string at a UTF-8 boundary (256 bytes, 16 for interface and congestion names) and replaces invalid UTF-8, C0, DEL and C1 with U+FFFD; printable ASCII that fits returns without allocating. Applied once per entity: dockermeta inspect (name, image), the uplink stamp (NIC strings, LLDP fields), localnet ifnames, the ipasn owner, netns names, and the congestion decode, which folds the check into its NUL scan (+3 ns per socket, allocs unchanged). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Send used to block the poller once 16 envelopes waited on a slow or
unreachable S3. envelopeQueue drops the oldest past -s3QueueDepth
(default 16, max 4096) or -s3MaxBufferedBytes (default 64 MiB, 0 = no
byte bound), always keeping the newest. New xtcp_s3_dropped_total,
xtcp_s3_dropped_bytes_total and xtcp_s3_buffered_bytes{stage};
queueFull now counts drops. XtcpConfig fields 116/117, env
S3_QUEUE_DEPTH / S3_MAX_BUFFERED_BYTES, kept across Set by preserveCaps.
Docs: metrics, memory budget, plan FP-6 done-as, CHANGELOG. Also polls
in TestS3ParquetDest_timeFlush, which failed under -race on a fixed
30 ms sleep.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Check 14c: with -s3QueueDepth 2, a Garage outage must keep polls at cadence, raise xtcp_s3_dropped_total, keep RSS growth under 128 MiB, and land a new object after Garage restarts (S3PARQUET_OUTAGE). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…3 queue env/print in helpers (funlen) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
FP-6 of the security-hardening plan (C3, C4): a tenant or an S3 outage can cost data, not the collector.
S3 queue
Sendnever blocks: it used to stall the poller mid-poll once 16 envelopes waited on S3.envelopeQueue(pkg/xtcp/s3queue.go) drops the oldest past-s3QueueDepth(default 16, max 4096) or-s3MaxBufferedBytes(default 64 MiB,0= no byte bound), always keeping the newest.xtcp_s3_dropped_total{reason},xtcp_s3_dropped_bytes_total{reason},xtcp_s3_buffered_bytes{stage};queueFullnow counts drops.XtcpConfigfields 116/117, envS3_QUEUE_DEPTH/S3_MAX_BUFFERED_BYTES; startup-only (preserveCapskeeps them acrossSet).GOMEMLIMITguidance (≈ 190 MiB with defaults).String policy
pkg/strpolicy.Clean: cut at a UTF-8 boundary (256 bytes, 16 for ifnames and congestion names), invalid UTF-8 and C0/DEL/C1 become U+FFFD; printable ASCII returns without allocating.Tests / evidence
TestClean,FuzzClean,TestEnvelopeQueue(+ concurrent,-race),TestS3ParquetDest_queueBounds, reworkedcorner_queueFull, one test per call site, flag/env/validation/preserveCapsrows.BenchmarkDeserializeCongInfoXTCPvs main (10 interleaved): 21.0 → 23.3 ns, allocs unchanged;BenchmarkS3Send52 ns vs 118 ns for the old channel send.S3PARQUET_OUTAGE): Garage stopped mid-run → polls continue, 22 drops, RSS +5 MB, upload resumes after restart.microvm-x86_64-lifecycle-s3parquet: all checks pass.TestS3ParquetDest_timeFlush, which failed under-raceon main (fixed 30 ms sleep).Follow-ups (plan doc TODOs)
max_lenfor operator strings (label,tag,location,hostname).🤖 Generated with Claude Code