Nop
Nop3mo ago

QUIC QuicReceiveStream read() panics when peer disconnects

Deno panics when I'm waiting for a stream after the peer has disconnected. The panic cannot be caught with a try/catch. Code:
const reader = (await conn.incomingUnidirectionalStreams.getReader().read()).value.getReader();
while(true) {
try {
const msg = await reader.read();
}catch(e) {
console.error(e);
}
}
const reader = (await conn.incomingUnidirectionalStreams.getReader().read()).value.getReader();
while(true) {
try {
const msg = await reader.read();
}catch(e) {
console.error(e);
}
}
Output:
NotConnected: connection lost
at async Object.pull (ext:deno_web/06_streams.js:941:27) {
name: "NotConnected",
code: "ENOTCONN"
}
error: Uncaught (in promise) Error: timed out
NotConnected: connection lost
at async Object.pull (ext:deno_web/06_streams.js:941:27) {
name: "NotConnected",
code: "ENOTCONN"
}
error: Uncaught (in promise) Error: timed out
Many thanks in advance. I really appreciate the new feature!
1 Reply
Hiro
Hiro2mo ago
Hello there, I have looked into this and indeed there seems to be an non catcher promise in the Quic connection, I’m on my phone right now but I will publish the issue tomorrow. I couldn’t wrap my head around what was wrong but yeah, it doesn’t catch any client disconnect and will just timeout after maxIdleTimeOut Btw, what Os are you using ?

Did you find this page helpful?