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 SQL UPDATE errors on long running jobs #1266

Merged
merged 4 commits into from
Jan 30, 2025
Merged

Conversation

hectorcorrea
Copy link
Member

@hectorcorrea hectorcorrea commented Jan 30, 2025

Closes #1263

Thanks to @carolyncole for the pointer on what we did in PDC Describe for these kind of errors.

@coveralls
Copy link

coveralls commented Jan 30, 2025

Coverage Status

coverage: 83.532% (+0.02%) from 83.508%
when pulling 0f34980 on file-list-job
into 1d99046 on main.

Comment on lines +60 to +62
rescue ActiveRecord::StatementInvalid
ActiveRecord::Base.connection_pool.release_connection
retry
Copy link
Member Author

@hectorcorrea hectorcorrea Jan 30, 2025

Choose a reason for hiding this comment

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

This is the important bit...handle this particular exception with a retry but asking ActiveRecord to get a new connection since the old one is probably stale.

Copy link
Member

@carolyncole carolyncole left a comment

Choose a reason for hiding this comment

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

Thanks @hectorcorrea

@carolyncole carolyncole merged commit 9634378 into main Jan 30, 2025
2 checks passed
@carolyncole carolyncole deleted the file-list-job branch January 30, 2025 19:53
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.

File inventory job error
3 participants