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

Handle pymysql OperationalError in worker script #42

Merged
merged 7 commits into from
Jun 12, 2024

Conversation

gvozdetsky
Copy link
Contributor

An exception clause for pymysql's OperationalError has been included in the worker script. Query run (qrun) status is now updated to 'failed' and logged for operational exceptions, thus improving error handling and traceability.

Bug: T365136

@gvozdetsky
Copy link
Contributor Author

Bug: T365136

quarry/web/worker.py Show resolved Hide resolved
quarry/web/worker.py Outdated Show resolved Hide resolved
quarry/web/worker.py Outdated Show resolved Hide resolved
quarry/web/worker.py Outdated Show resolved Hide resolved
quarry/web/worker.py Outdated Show resolved Hide resolved
quarry/web/worker.py Outdated Show resolved Hide resolved
siddharthvp
siddharthvp previously approved these changes Jun 12, 2024
Copy link
Collaborator

@siddharthvp siddharthvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working fine.

gvozdetsky and others added 6 commits June 13, 2024 00:22
An exception clause for pymysql's OperationalError has been included in the worker script. Query run (qrun) status is now updated to 'failed' and logged for operational exceptions, thus improving error handling and traceability.

Bug: T365136
In an effort to facilitate debugging, the codebase now captures all exceptions rather than specifically pymysql.err.OperationalError. Alongside this, an error's traceback is being formatted and logged for additional context about the error's origin. Furthermore, the additional information pertaining to the error is now being serialized and stored into the 'extra_info' field of the 'qrun' object.

Bug: T365136
Copy link
Collaborator

@siddharthvp siddharthvp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(rebased)

@siddharthvp siddharthvp merged commit 6b784b4 into toolforge:main Jun 12, 2024
3 checks passed
@siddharthvp
Copy link
Collaborator

@vivian-rook - could you deploy this one as well?

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

Successfully merging this pull request may close these issues.

2 participants