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

Add sockct close v2 #1168

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yangrudan
Copy link

What changes were proposed in this pull request?

  1. add socket close action;
  2. fix request misspell.

Why are the changes needed?

  1. avoid resoure leaks.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

By run unit test.

Copy link

codecov bot commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 76.08696% with 22 lines in your changes missing coverage. Please review.

Project coverage is 79.66%. Comparing base (0c18cc5) to head (3720f4c).

Files Patch % Lines
dlrover/python/common/multi_process.py 76.08% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1168      +/-   ##
==========================================
- Coverage   79.67%   79.66%   -0.02%     
==========================================
  Files         210      210              
  Lines       18681    18709      +28     
==========================================
+ Hits        14885    14905      +20     
- Misses       3796     3804       +8     

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

@yangrudan
Copy link
Author

@workingloong How to supply exception testing?

Copy link
Collaborator

@workingloong workingloong left a comment

Choose a reason for hiding this comment

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

LGTM

@workingloong
Copy link
Collaborator

@workingloong How to supply exception testing?

You can patch the method of socket in your test cases to raise an OSError like

def _mock_rendezvous(self, *args):
raise RendezvousOutSyncError("test")
agent._rendezvous = _mock_rendezvous
with self.assertRaises(TimeoutError):
agent._initialize_workers(agent._worker_group)

@BalaBalaYi
Copy link
Collaborator

@yangrudan Please resolve the conflicts.

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