events: don't call resume after close (fix readline regression)#60548
Open
ChALkeR wants to merge 1 commit intonodejs:mainfrom
Open
events: don't call resume after close (fix readline regression)#60548ChALkeR wants to merge 1 commit intonodejs:mainfrom
ChALkeR wants to merge 1 commit intonodejs:mainfrom
Conversation
b9ac594 to
2629acb
Compare
2629acb to
fc0cfb7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60548 +/- ##
==========================================
- Coverage 88.52% 88.52% -0.01%
==========================================
Files 704 704
Lines 208802 208884 +82
Branches 40318 40335 +17
==========================================
+ Hits 184842 184906 +64
- Misses 15947 15972 +25
+ Partials 8013 8006 -7
🚀 New features to boost your workflow:
|
fc0cfb7 to
9bedc04
Compare
b9076cd to
8f2e714
Compare
Member
Author
|
Rebased |
Member
Author
|
cc @jasnell @lpinca @dario-piotrowicz Can this get a review pls? |
Collaborator
Collaborator
Collaborator
Collaborator
Collaborator
gurgunday
reviewed
Jan 29, 2026
| @@ -1073,7 +1073,7 @@ function on(emitter, event, options = kEmptyObject) { | |||
| const value = unconsumedEvents.shift(); | |||
| size--; | |||
| if (paused && size < lowWatermark) { | |||
Member
There was a problem hiding this comment.
@ChALkeR why not gate it here?
The !finished gate could be better because it prevents the invalid resume() call only after shutdown, without mutating the iterator’s paused state.
Suggested change
| if (paused && size < lowWatermark) { | |
| if (paused && !finished && size < lowWatermark) { |
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.
Fixes: #60507
Regression from: #58283
Since #58283, readline is not compatible with
EventEmitter.on(and readline own async iterator)It throws on attempting to
.resumethe stream after it was closed, which was whatEventEmitter.onwas doingAnother option is to make
.resumea noop in closed state instead of throwing