jmalloc / ax

A message-driven application toolkit for Go. [EXPERIMENTAL]
MIT License
9 stars 3 forks source link

Retry optimistic lock failures without requiring message redelivery. #93

Closed jmalloc closed 7 months ago

jmalloc commented 6 years ago

Several of the repository / store interfaces use optimistic concurrency control, however the systems that consume those interfaces do not currently have a way to tell when a write fails due to an optimistic lock failure.

If this information was known, those systems could perform immediate retries when such a lock failure occurs.

We can either make a specific error type, to be returned by all of these interfaces, or perhaps just use an ok bool to indicate such a failure.

This is particularly important for the projection consumers, as they currently have no retry mechanism as they do not use a transport.

jmalloc commented 6 years ago

The places where such OCC failures occur are now labelled with:

TODO: use OCC error https://github.com/jmalloc/ax/issues/93