Page MenuHomePhabricator

Improve Database connection loss handling
Closed, ResolvedPublic

Description

Copied from T215107#4963154 :

Actionables:

  • Database::replaceLostConnection should clean up callbacks before reopening the connection (it's done in handleSessionLoss which is called way too late). Except it also tries to run trxEndCallbacks callbacks (which should survive a rollback) and those need an open connection... so maybe split it in two?
    • Also Database::replaceLostConnection should somehow force the open/close logic it calls to ignore trxEndCallbacks and not throw exceptions because of it being set.
  • Maybe mark when a connection was closed due to errors and ignore rollback calls in such case? If the connection is lost, the transaction has effectively been rolled back, maybe log a warning but otherwise better to treat it as success than to throw an exception.

Event Timeline

aaron created this task.Mar 13 2019, 4:00 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 13 2019, 4:00 PM

Change 496363 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] rdbms: improve database connection loss handling

https://gerrit.wikimedia.org/r/496363

Change 496362 had a related patch set uploaded (by Aaron Schulz; owner: Aaron Schulz):
[mediawiki/core@master] rdbms: make Database::query() more readable and consistent

https://gerrit.wikimedia.org/r/496362

Krinkle updated the task description. (Show Details)

Change 496362 merged by Krinkle:
[mediawiki/core@master] rdbms: make Database::query() more readable and consistent

https://gerrit.wikimedia.org/r/496362

aaron claimed this task.Mar 15 2019, 8:25 AM

Change 496363 merged by jenkins-bot:
[mediawiki/core@master] rdbms: improve database connection loss handling

https://gerrit.wikimedia.org/r/496363

aaron closed this task as Resolved.Mar 18 2019, 8:54 PM