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

Close DB connection before job completion #918

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

jjmerchante
Copy link
Contributor

RQ workers create a fork to run the function. The issue arises when, after completing the job, the MariaDB logs display the warning: Aborted connection to db. Got an error reading communication packets. This change ensures the database connection is closed before the fork ends, preventing the warning from appearing.

Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

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

LGTM but can we call the new class SortingHatJob or something like that. Then, explain in the docstring that it's a class to change the default behaviour of RQ Job, and describe the problem with the connection (as it's described now in the docstring).

@jjmerchante jjmerchante force-pushed the fix-sql-warning branch 6 times, most recently from 2548048 to 692c13c Compare August 30, 2024 10:27
RQ workers create a fork to run the function. The issue arises
when, after completing the job, the MariaDB logs display the
warning:  `Aborted connection to db. Got an error reading
communication packets`. This change ensures the database
connection is closed before the fork ends, preventing the
warning from appearing.

Signed-off-by: Jose Javier Merchante <jjmerchante@bitergia.com>
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

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

LGTM

@sduenas sduenas merged commit 98b7dea into chaoss:master Aug 30, 2024
10 checks passed
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.

2 participants