fix(logger): avoid infinite recursion when isolate log port fails - #1380
Open
sneurlax wants to merge 3 commits into
Open
fix(logger): avoid infinite recursion when isolate log port fails#1380sneurlax wants to merge 3 commits into
sneurlax wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #1380 +/- ##
===========================================
- Coverage 4.84% 4.84% -0.01%
===========================================
Files 1092 1092
Lines 109141 109148 +7
===========================================
Hits 5283 5283
- Misses 103858 103865 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
julian-CStack
requested changes
May 27, 2026
julian-CStack
left a comment
Collaborator
There was a problem hiding this comment.
I agree this could be improved. But I do not thick these requested changes are the solution.
I've talked to someone before about this exact spot but I cannot remember who.
Member
Author
sneurlax
force-pushed
the
fix/logger-recursion
branch
from
August 21, 2026 00:51
1cb505a to
7b5f665
Compare
Member
Author
|
OK, errors are typically written to
|
Route every log through LoggerDispatcher, whose failure path reports to a fallback instead of re-entering log() and recursing until the stack overflows. Spawn the worker from a top-level entry taking a record so the Logging instance is never copied into the isolate, and drop the port name once the worker reports an error or exits.
Write failed dispatches to emergency.txt beside latest.txt so a log lost to an unavailable worker still leaves a record. The emergency path builds its file paths with package:path, so it stays correct on every platform.
Watch error and exit on one port so a worker failure is recorded once, then restart the worker up to three times per process. Emergency writes are coalesced to one record per second and the emergency log is rotated across two files of at most 1 MiB each.
sneurlax
force-pushed
the
fix/logger-recursion
branch
from
August 25, 2026 00:03
b526b92 to
9eb882e
Compare
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.
No description provided.