Skip to content

SpringImportJob: don't swallow DBError from doImport() - #1

Open
claude[bot] wants to merge 1 commit into
mainfrom
fix/import-job-deadlock-retry
Open

claude[bot] wants to merge 1 commit into
mainfrom
fix/import-job-deadlock-retry

Conversation

@claude

@claude claude Bot commented Sep 14, 2026

Copy link
Copy Markdown

Requested via Slack thread

Before: WikiImporter::doImport() deadlocks on the actor table while acquiring an actor for an imported foreign user (INSERT IGNORE INTO actor ... 'w>Vogone', MySQL 1213). The generic catch ( Throwable ) logs it and returns true, so the job is marked done while the transaction is still in ERROR state. JobRunner then fails its commit (Commit failed on server(s) db-c1-us-east-021) and the rest of the import is dropped with no retry.

After: DBError propagates out of run(). The job runner rolls back, logs, and requeues the job, which is the documented recovery for error 1213. Non-DB import failures keep their existing log-and-give-up behaviour.

Sentry: MEDIAWIKI-C74 / C75 / C76.

How

Catch DBError before the Throwable handler in SpringImportJob::run() and rethrow it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MuStKvs3pWiFUNmf615dgN


Generated by Claude Code

A deadlock on the actor table (ActorStore::acquireActorId, INSERT IGNORE
on an imported foreign user) was caught by the generic Throwable handler,
which logged and returned true. The job was marked done while the
transaction was left in ERROR state, so JobRunner's commit then failed and
the remaining import work was dropped without a retry.

Rethrow DBError so the job runner rolls back and requeues.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MuStKvs3pWiFUNmf615dgN
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d64351a3-6dce-49f1-b85c-008322b42dde

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant