You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constconn=awaitDeno.connect({port: 4444});asyncfunctionreqRes(){console.log("[cli] writing");constnw=awaitconn.write(newUint8Array([0,1,2,3]));console.log("[cli] written",nw);constbuf=newUint8Array(4);console.log("[cli] reading");constnr=awaitconn.read(buf);console.log("[cli] read done",nr);}// First request-response: awaitreqRes();// Second request-response: expect error as conn is closed by serversetTimeout(async()=>{try{awaitreqRes();}catch(e){console.error(e);}finally{conn.close();}console.log("[cli] close",Deno.resources());},200);
[cli] writing
[cli] written 4
[cli] reading
[cli] read done 4
[cli] writing
[cli] written 4
[cli] reading
ConnectionReset: Connection reset by peer (os error 54)
at Object.constructError ($deno$/errors.ts:43:13)
at unwrapResponse ($deno$/dispatch_minimal.ts:59:12)
at Object.sendAsyncMinimal ($deno$/dispatch_minimal.ts:102:10)
at async Object.read ($deno$/files.ts:154:17)
at async reqRes (file:///Users/keroxp/src/deno-pg/conn/client.ts:8:14)
at async file:///Users/keroxp/src/deno-pg/conn/client.ts:16:5
[cli] close { 0: "stdin", 1: "stdout", 2: "stderr" }
<- exit
Guess
Some async handle by conn.read(buf) won't be released after conn.close() or listener.close() called if it hasn't be resolved. I think Closer should cleanup unresolved IO handle.
The text was updated successfully, but these errors were encountered:
Assigning to @piscisaureus just to keep track of this. We've discussed this in some detail and came to the conclusion that this will require some work to fix.
First thing is we need a smaller test that involves just listen, accept, read.
At first, this is very complicated situation.
Problem occurred
listener.close()
called.Code
These are very simple request-response type TCP server and client.
server.ts
client.ts
Logs
server.ts
client.ts
Guess
Some async handle by
conn.read(buf)
won't be released afterconn.close()
orlistener.close()
called if it hasn't be resolved. I think Closer should cleanup unresolved IO handle.The text was updated successfully, but these errors were encountered: