fix(actions): retry workflow insertion on database deadlock #221
Reference in New Issue
Block a user
Delete Branch "fix/220-actions-deadlock-retry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Root Cause
When multiple workflows match a single event, each InsertRun transaction acquires:
Two concurrent transactions deadlock when each holds one lock and waits for the other. InnoDB kills the lighter transaction, but handleWorkflows only logged the error and moved on -- silently dropping the workflow run.
API-created PRs were hit harder because they tend to be created during active CI, increasing lock contention. This matches upstream Gitea #36234.
Test plan
Closes #220