tiernacity
tiernacity•10mo ago

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?
$20/03/2024, 11:53:21 [CONVEX M(<mutation_name>)] Documents read from or written to the "<table_name>" table changed while this mutation was being run and on every subsequent retry. A call to "scheduled_job_mutation_success" changed the document with ID "<id>. See https://docs.convex.dev/error#1"
$20/03/2024, 11:53:21 [CONVEX M(<mutation_name>)] Documents read from or written to the "<table_name>" table changed while this mutation was being run and on every subsequent retry. A call to "scheduled_job_mutation_success" changed the document with ID "<id>. See https://docs.convex.dev/error#1"
Errors and Warnings | Convex Developer Hub
This page explains specific errors thrown by Convex.
4 Replies
The Cyberverse
The Cyberverse•10mo ago
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
Michal Srb
Michal Srb•10mo ago
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.
tiernacity
tiernacityOP•10mo ago
Ok thanks @Michal Srb that's what I was looking for (also, thanks @The Cyberverse)
The Cyberverse
The Cyberverse•10mo ago
No problem @tiernacity 🙂

Did you find this page helpful?