cloudflare / cloudflare/workerd
🐛 Bug Report — Response closed due to connection limit
- Dominant language
- C++
- Stars
- 8.7k
- Forks
- 739
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 174
Description
I'm trying to understand an error we encounter: `Response closed due to connection limit`. We have a setup involving multiple Workers and Durable Objects:
- `Worker A`: Initiates an RPC call to `Worker B`.
- `Worker B`: Receives the RPC call and then calls a Durable Object `DO1` (defined on `Worker B`) through another RPC call.
- Durable Object `DO1`: Attempts to return data directly from the Cache API.
- If the data is not in the cache, it performs a fetch on another Durable Object `DO2` (defined on `Worker A`), which uses DO storage (KV, not SQLite).
- Writes the response from `DO2` to the Cache API in a `waitUntil` in `DO1` using a teed body
All RPC calls return responses to benefit from streaming.
This error occurs only on Worker B, or at least that's the only place where it has been reported so far. This error also does not happen every single time.
The error could potentially be on our side, but even if that's the case, I feel like this error message could be improved for better debugging.
I have tried to create a simple reproduction of the issue but I haven't been successful so far.
Contributor guide
Assessment
This issue has not been assessed yet.