Skip to content

Commit c3b8e4f

Browse files
committed
Fix hang when closing connections under load
1 parent 0a186de commit c3b8e4f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/common/persistence/FSExtentStore.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,18 @@ export default class FSExtentStore implements IExtentStore {
518518
let count: number = 0;
519519
let wsEnd = false;
520520

521+
if (!rs.readable) {
522+
this.logger.debug(
523+
`FSExtentStore:streamPipe() Readable stream is not readable, rejecting streamPipe.`,
524+
contextId
525+
);
526+
reject(
527+
new Error(
528+
`FSExtentStore:streamPipe() Readable stream is not readable.`
529+
));
530+
return;
531+
}
532+
521533
rs.on("data", data => {
522534
count += data.length;
523535
if (!ws.write(data)) {

0 commit comments

Comments
 (0)