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

More robust gRPC connections, using tenacity where possible #521

Merged
merged 7 commits into from
Jun 18, 2024

Conversation

MaxiBoether
Copy link
Contributor

@MaxiBoether MaxiBoether commented Jun 18, 2024

Sometimes, we face outages/random disconnections during training. This fixes it in places where I encountered it last night. I tried to integrate tenacity as suggested by @robinholzi, but it's not always possible since the retry logic involves keeping track of already done work, which I don't want to put into class state

Part 6/n of porting over SIGMOD changes.

@MaxiBoether MaxiBoether changed the title More robust gRPC connections, using tenacity where possible More robust gRPC connections, using tenacity where possible Jun 18, 2024
@robinholzi
Copy link
Collaborator

robinholzi commented Jun 18, 2024

@MaxiBoether Not fully what the problem with partial result states is, but have you considered using retry contexts?

@MaxiBoether
Copy link
Contributor Author

@MaxiBoether Not fully what the problem with partial result states is, but have you considered using retry contexts?

Ah, nope. I guess I can refactor the code to retry contexts then

Copy link

codecov bot commented Jun 18, 2024

Codecov Report

Attention: Patch coverage is 71.59091% with 25 lines in your changes missing coverage. Please review.

Project coverage is 82.50%. Comparing base (75868bb) to head (ac1d863).

Current head ac1d863 differs from pull request most recent head 19cde94

Please upload reports for the commit 19cde94 to get more accurate results.

Files Patch % Lines
...n/evaluator/internal/dataset/evaluation_dataset.py 61.11% 14 Missing ⚠️
modyn/supervisor/internal/grpc_handler.py 50.00% 5 Missing ⚠️
.../internal/pipeline_executor/evaluation_executor.py 54.54% 5 Missing ⚠️
.../trainer_server/internal/dataset/online_dataset.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #521      +/-   ##
==========================================
- Coverage   82.55%   82.50%   -0.05%     
==========================================
  Files         214      214              
  Lines        9975    10039      +64     
==========================================
+ Hits         8235     8283      +48     
- Misses       1740     1756      +16     

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

@MaxiBoether MaxiBoether requested a review from robinholzi June 18, 2024 15:30
@MaxiBoether
Copy link
Contributor Author

@MaxiBoether Not fully what the problem with partial result states is, but have you considered using retry contexts?

Thanks for suggesting that. I adapted the code. However, I needed to manually catch and reraise exceptions sometimes because I find their callback system to be quite ugly in object-oriented contexts (we need to write a static function that recovers self out of args[0] etc). I think this actually looks better than using callbacks, and it allows for easier logging with our logging infra. The retry logic itself is still more hidden now :)

Copy link
Collaborator

@robinholzi robinholzi left a comment

Choose a reason for hiding this comment

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

Thanks for the refactoring! Looks good now :)

Copy link

Line Coverage: -% ( % to main)
Branch Coverage: -% ( % to main)

@MaxiBoether MaxiBoether merged commit 0a511bb into main Jun 18, 2024
18 checks passed
@MaxiBoether MaxiBoether deleted the feature/MaxiBoether/robustgrpc branch June 19, 2024 18:16
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