ref(core): Remove redundant log buffer flush#22278
Merged
Merged
Conversation
Rely on Client.flush() to emit the flush hook and drain the enabled log buffer once when the client closes. Co-Authored-By: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
size-limit report 📦
|
chargome
approved these changes
Jul 15, 2026
| .mockImplementation(() => undefined); | ||
|
|
||
| const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN }); | ||
| const options = getDefaultTestClientOptions({ dsn: PUBLIC_DSN, enableLogs: true }); |
Member
Author
There was a problem hiding this comment.
yes, the client guards the setupWeightBasedFlushing with enableLogs (something I imagine we wanna change for v11). So the test before called the flush function even if logs were disabled.
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.
This PR removes the explicit log-buffer flush from
Client.close().Client.flush()(called byclose) already emits the flush hook, which we listen to insetupWeightBasedFlushingfor logs and metrics. So the explicit call flushes enabled log buffers twice.ref #19347
(just found this while going over our closing logic, so figured I'd remove the line)