OCC and retries and errors, oh my
Hey Convex I'm trying to understand the behaviour of optimistic locking and retries, as it applies to my scenario and some errors I'm seeing. Your docs (here) say a mutation will get "several retries" before an error is thrown. It's possible to get more information about what "several retries" means?
I'm also confused about whether the below log message is a (soft) warning or a (hard) error/failure. When I inspect my data in the dashboard, it looks like my mutation succeeded - so I think it's a warning? What's the retry behaviour and what are the thresholds/limits?
Errors and Warnings | Convex Developer Hub
This page explains specific errors thrown by Convex.
4 Replies
I think what Convex means by several retries,is that whenever the function is executed multiple times, some mutations might conflict with each other ie. two function executions trying to update the counter from 3 to 4, so convex retries the functions to make sure that one executes after another, If that doesn't happen, it returns that error
This is a hard failure, that call of <mutation_name> did not commit.
If <mutation_name> is
"scheduled_job_mutation_success"
, you might have been writing the same information at the same time from multiple calls, and this is why you see it reflected in your data.
We currently retry 3 times.Ok thanks @Michal Srb that's what I was looking for (also, thanks @The Cyberverse)
No problem @tiernacity 🙂