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

Improve exception-handling in SacessOptimizer #1517

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Nov 25, 2024

Previously, uncaught exceptions in SacessOptimizer worker processes would have resulted in deadlocks in SacessOptimizer.minimize.

These changes will (in most cases) prevent deadlocks and other errors due to missing results from individual workers. Furthermore, this will lead to termination of minimize() relatively soon after an error occurred on some worker - not only after some other exit criterion is met.

Closes #1512.

@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 79.36508% with 13 lines in your changes missing coverage. Please review.

Project coverage is 82.78%. Comparing base (6c049f5) to head (a3511d8).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
pypesto/optimize/ess/sacess.py 79.03% 13 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1517      +/-   ##
===========================================
- Coverage    82.80%   82.78%   -0.03%     
===========================================
  Files          163      163              
  Lines        13962    14007      +45     
===========================================
+ Hits         11561    11595      +34     
- Misses        2401     2412      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Previously, uncaught exceptions in SacessOptimizer worker processes would have resulted in deadlocks in `SacessOptimizer.minimize`.

These changes will (in most cases) prevent deadlocks and other errors due to missing results from individual workers.
Furthermore, this will lead to termination of minimize() relatively soon after an error occurred on some worker - not only after some other exit criterion is met.

Closes ICB-DCM#1512.
@dweindl dweindl marked this pull request as ready for review November 25, 2024 18:25
@dweindl dweindl self-assigned this Nov 26, 2024
Copy link
Collaborator

@PaulJonasJost PaulJonasJost left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you 🙏🏼

return worker.run(problem=problem, startpoint_method=startpoint_method)
return worker.run(problem=problem, startpoint_method=startpoint_method)
except Exception as e:
with suppress(Exception):
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need to suppress the exception here since we are already in an except? Or do you want to make sure it is definitely aborting?

Copy link
Member Author

Choose a reason for hiding this comment

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

It the logging fails for what ever reason, we don't care, but we need to ensure that the line below that block gets executed.

@dweindl dweindl added this pull request to the merge queue Nov 27, 2024
Merged via the queue into ICB-DCM:develop with commit 8f1bf80 Nov 27, 2024
18 checks passed
@dweindl dweindl deleted the 1512_sacess_errs branch November 27, 2024 10:59
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