Inconsistent Handling of TCP Stream Closure Causes BadResource Error in Deno #27133
Labels
ext/net
related to ext/net
needs investigation
requires further investigation before determining if it is an issue or not
triage required 👀
Deno team needs to make a decision if this change is desired
Version: deno 2.1.1 (stable, release, x86_64-unknown-linux-gnu)
BadResource
Error with Deno's TCP Stream HandlingDeno throws a
BadResource: Bad resource ID
error with an unhelpful stack trace that does not point to the user's code. The error occurs when a TCP connection is closed before the request body is fully read. It depends on request size and the execution context:Steps to Reproduce
ReadableStream.getReader()
.Code to Reproduce
Observed Error
When the above code is executed (in a single script), the server logs the initial chunks but eventually throws the following error:
Expected Behavior
Additional Information
I encountered this issue while investigating a related problem with Request.text() in Deno. I have filed a separate issue for that. These two issues may be connected. See #27132
The text was updated successfully, but these errors were encountered: