fs: do not swallow exceptions thrown by completion callbacks - #66308
Open
marcopiraccini wants to merge 2 commits into
Open
marcopiraccini wants to merge 2 commits into
marcopiraccini wants to merge 2 commits into
Conversation
Signed-off-by: marcopiraccini <marco.piraccini@gmail.com>
marcopiraccini
marked this pull request as ready for review
September 26, 2026 03:53
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66308 +/- ##
==========================================
+ Coverage 90.36% 90.39% +0.02%
==========================================
Files 790 790
Lines 274292 274275 -17
Branches 52510 52491 -19
==========================================
+ Hits 247874 247927 +53
+ Misses 16901 16837 -64
+ Partials 9517 9511 -6
🚀 New features to boost your workflow:
|
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.
Since #57706 the completion callbacks of
fs.mkdtemp,fs.realpath.native,fs.readlink,fs.mkdir({ recursive }),fs.readdir({ recursive })anddir.read()call into JS while theTryCatchmeant forStringBytes::Encodeis still in scope.Any exception thrown by the user callback, or by the
nextTickqueue drained right after it (e.g. afterawait fsp.mkdtemp()), is swallowed: the process prints nothing and exits 0, anduncaughtExceptionnever fires. v22 is not affected.This moves the
TryCatchinto a small helper that produces the value first and callsResolve()/Reject()only after leaving it.Fixes: #65667
NOTE:
make lint-jscurrently fails until #66307 lands