Client disconnected
I have observed multiple instances of Client Disconnected invocation errors on my Worker. As I understand it this is caused by the client disconnecting (link) . All my requests come from the same source and 99.5% of them are successful. Each call also takes no more than 2 seconds to execute attached is a sample request which never finished executing. How do I recreate this and fix this?
Cloudflare Docs
Metrics and analytics · Cloudflare Workers docs
Diagnose issues with Workers metrics, and review request data for a zone with Workers analytics.


5 Replies
You can't really, clients always have a chance of losing connection/closing their browser/etc
The fact that they show as "errors" has been talked about before, imo not true errors but could show client side problems if you had configured a timeout, for example
Thanks @Chaika I am unsure if that is specifically the problem here because I tried using and was unable to recreate it. Is there. Also the calling application is not a browser. Do you know of a way to realiably recreate this error?
it looks like your worker only took 3s in the screenshot above
you need to disconnect before the response
so do like max-time 1
or like 0.4
https://test.walshydev.workers.dev/client-disconnect is my repro of this issue

Thanks @Walshy so is the workaround to set a timeout for any external call to ~1000ms and reprocessing the request?