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.
From An unknown user
From An unknown user
No description
5 Replies
Chaika
Chaika2mo ago
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
K!NG
K!NGOP2mo ago
Thanks @Chaika I am unsure if that is specifically the problem here because I tried using
curl --max-time 10 <WORKER_URL>
curl --max-time 10 <WORKER_URL>
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?
Walshy
Walshy2mo ago
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
K!NG
K!NGOP2mo ago
Thanks @Walshy so is the workaround to set a timeout for any external call to ~1000ms and reprocessing the request?

Did you find this page helpful?