Skip to content

Fix UDS writer flush() to reset buffer synchronously#126

Merged
ecbadeaux merged 1 commit into
Netflix:mainfrom
mason-albert:masona/fix-flush
Jun 2, 2026
Merged

Fix UDS writer flush() to reset buffer synchronously#126
ecbadeaux merged 1 commit into
Netflix:mainfrom
mason-albert:masona/fix-flush

Conversation

@mason-albert

Copy link
Copy Markdown
Contributor

UdsWriter.flush() deferred the buffer reset onto a chained microtask, which could let repeated writes past _maxBufferBytes queue duplicate drainBuffer calls. In NQ canaries, this may have become a microtask flood that pins a CPU at 100%. Mirror UdpWriter's pattern by snapshotting the payload synchronously in flush()/close() before chaining the send.

NodeQuark canaries on UDS pin at 100% CPU 5-30 min after startup with no consistent trigger, I'd be curious to see if canaries with this change show any improvement

@ecbadeaux
ecbadeaux merged commit 8ba823a into Netflix:main Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants