You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Duplicate txn.call_after calls when transactions are retried #12184
When a transaction fails with a SerializationFailure, Synapse will retry it up to 5 times (inside new_transaction). Although a new Cursor is created for each attempt, the same after_callbacks list is reused. This means that if a transaction fails, then succeeds on the next attempt, the after_callbacks from the previous failed attempt will also run.
These callbacks are mostly used for cache invalidation, so this is probably okay?
Conclusion from meeting: let's note this behavior in in the call_* function docstrings, but leave the behavior unchanged.
There are legitimate uses for both modalities, so if we wanted to address it we'd likely want to extend the API surface to indicate whether duplicate callbacks should be enqueued or not. But we'll hold off on that until we have a concrete motivation to make the change.
Activity
clokep commentedon Mar 9, 2022
Does this need discussion of what the proper behavior should be?
squahtx commentedon Mar 9, 2022
Probably? Let's stick it in the needs-discussion bucket.
callahad commentedon Mar 10, 2022
Conclusion from meeting: let's note this behavior in in the
call_*function docstrings, but leave the behavior unchanged.There are legitimate uses for both modalities, so if we wanted to address it we'd likely want to extend the API surface to indicate whether duplicate callbacks should be enqueued or not. But we'll hold off on that until we have a concrete motivation to make the change.