-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
type/documentationRegarding website, API documentation, README, etc.Regarding website, API documentation, README, etc.
Milestone
Description
The time-based input limiting contains a buffer, that gets drained only once all chunks were handled.
This way fast producers can easily exhaust memory and will crash the terminal / browser engine.
Relevant code:
Lines 1441 to 1447 in af81acc
| if (this.writeBuffer.length > bufferOffset) { | |
| // Allow renderer to catch up before processing the next batch | |
| setTimeout(() => this._innerWrite(bufferOffset), 0); | |
| } else { | |
| this._writeInProgress = false; | |
| this.writeBuffer = []; | |
| } |
Partial fix: Trim/slice already handled chunks from the buffer.
Even with this partial fix a long running producer that is faster than the terminal can handle incoming chunks will grow the buffer up to a possible crash. For a full fix we have to implement a reliable back pressure mechanism.
Metadata
Metadata
Assignees
Labels
type/documentationRegarding website, API documentation, README, etc.Regarding website, API documentation, README, etc.