Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLATFORM-9121 | Do not swallow DB errors in Cargo query #21

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

mszabo-wikia
Copy link

Cargo currently swallows all exceptions thrown while it is running queries, mainly because it may throw MWExceptions as validation errors which should be formatted nicely without breaking the rest of the page. However, the queries themselves may fail due to transient database issues, and Cargo wraps the resulting DBError exceptions as well without much ado. The effect is that these errors never get logged (so we don't even know how often this happens), and the error gets cached in parser cache and on the CDN, forcing people to check for and periodically purge pages with such errors.

Instead, detect and rethrow errors coming from MediaWiki's DBAL so that we can track them in our logs, and so that they do not get cached.

Cargo currently swallows all exceptions thrown while it is running
queries, mainly because it may throw MWExceptions as validation errors
which should be formatted nicely without breaking the rest of the page.
However, the queries themselves may fail due to transient database
issues, and Cargo wraps the resulting DBError exceptions as well without
much ado. The effect is that these errors never get logged (so we don't
even know how often this happens), and the error gets cached in parser
cache and on the CDN, forcing people to check for and periodically purge
pages with such errors.

Instead, detect and rethrow errors coming from MediaWiki's DBAL so that
we can track them in our logs, and so that they do not get cached.
@harnash
Copy link

harnash commented Mar 6, 2024

Tested on sandbox and no errors detected.

@harnash harnash merged commit 39eca5c into REL1_39 Mar 6, 2024
2 checks passed
@harnash harnash deleted the PLATFORM-9121 branch March 6, 2024 11:10
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.

3 participants