Skip to content

Conversation

@jlashner
Copy link
Contributor

This PR adds some protection to the pysmurf-monitor main process, to protect against sqlalchemy operational errors crashing the main loop.

Description

  • On OperationalError, this will now just set the session.degraded = True and sleep 5 sec until next iteration.
    • It will not clear cached files that need to be added to the database
  • This PR also adds basic type hinting to enable type checking

Motivation and Context

Resolves #712.

How Has This Been Tested?

This has not been tested yet. We really need to figure out how to test on a system that's not at site.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

jlashner and others added 2 commits August 23, 2024 14:22
- protect against OperationalError crashing main loop
- Adds basic type hinting
@jlashner jlashner requested a review from BrianJKoopman August 23, 2024 19:43
Copy link
Member

@BrianJKoopman BrianJKoopman left a comment

Choose a reason for hiding this comment

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

This looks good to me. If we had a system to test on, do you have a method for testing this?

@jlashner
Copy link
Contributor Author

I do not really have a good way to test it beyond the existing CI tests...

@BrianJKoopman BrianJKoopman self-requested a review August 26, 2024 19:40
@BrianJKoopman BrianJKoopman merged commit 26bf744 into main Aug 26, 2024
@BrianJKoopman BrianJKoopman deleted the pysmurf_monitor_robustness branch August 26, 2024 19:40
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.

Pysmurf monitor Operational Error

2 participants