kwhitley / itty-durable

Cloudflare Durable Objects + Itty Router = shorter code
MIT License
251 stars 18 forks source link

Automatically retry on network errors #33

Open sathoro opened 1 year ago

sathoro commented 1 year ago

Hey, thanks for this library. I was able to reduce our DO code by like 90%

We are using it in production and now that we are getting some significant request volume there are some transient DO network errors popping up.

For example, we have several Cannot resolve Durable Object due to transient issue on remote node. and Network connection lost. in Sentry. These are on routes that do nothing but connect to DO and return some data so even though there is no stack trace I am pretty confident both of these issues are DO related (well obviously the first one is, but no clue where else that second one would be coming from).

It was suggested in the CF Discord to do retrying but that will be quite messy to add in the user code.

Would it be possible for this library to automatically do retrying with backoff on these types of errors?

Thanks a lot!

sathoro commented 1 year ago

Related fix: https://github.com/dabblewriter/durable-apis/commit/dad78ba42f5d940e0d0ac1008f1306b255fa83ae

sathoro commented 1 year ago

I forked it and added the auto retrying in: https://github.com/kwhitley/itty-durable/compare/v1.x...sathoro:itty-durable:v1.x

Can't do a PR since I add to change some other code though