arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
601 stars 107 forks source link

Proper way of handling ECONNRESET error #719

Closed orgrimarr closed 3 years ago

orgrimarr commented 3 years ago

Hi, The issue #709 say that ECONNRESET error shouldn't be retried by arangojs because it can lead to data corruption.

My question is, if this error cannot be handled by arangojs, what is the best way to handle it in order to provide high availability / no downtime ?

If my query is a simple search, retrying the request in my code shouldn't be an issue. But what about an insert / update / a transaction ?

Is there a mecanism to check if a query as been processed by arango that i can use to retry my query safely ?

It is safe to retry every failed query outside arangojs ?

pluma commented 3 years ago

This question is really up to the application, not ArangoDB and depends on what exactly you were trying to do.

I don't think there's any generic way ArangoDB can tell you if whatever you tried succeeded. Depending on what you were trying to do you'll need to think about how to recover from a potential error before trying again.

Note that this isn't a problem unique to ArangoDB. This can happen with any network request if the connection drops before the response is received.

pluma commented 3 years ago

I'm closing this ArangoDB-related question due to inactivity. Please check the community slack if you need further assistance: https://slack.arangodb.com