Skip to content

Commit

Permalink
Fix and work.
Browse files Browse the repository at this point in the history
Signed-off-by: Qing Wang <kingchin1218@gmail.com>
  • Loading branch information
jovany-wang committed Jul 5, 2023
1 parent fcdb0a3 commit b593eb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 3 additions & 2 deletions fed/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,13 @@ def notify_to_exit():

def wait_sending():
global _check_send_thread
if _check_send_thread:
if _check_send_thread is not None:
notify_to_exit()
_check_send_thread.join()
_check_send_thread = None

global _sending_obj_refs_q
if _sending_obj_refs_q is not None:
# It's safe to reset `_sending_obj_refs_q` as another
# thread is stoped.
global _sending_obj_refs_q
_sending_obj_refs_q = None
7 changes: 0 additions & 7 deletions tests/test_repeat_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ def _run():
assert fed.cleanup._sending_obj_refs_q is None
compatible_utils.init_ray(address='local')
fed.init(cluster=cluster, party=party)
_start_check_sending()
time.sleep(0.5)
assert fed.cleanup._sending_obj_refs_q is not None
push_to_sending(True)
# Slightly longer than the queue polling
time.sleep(0.6)
assert fed.cleanup._sending_obj_refs_q is None

my1 = My.party("alice").remote()
my2 = My.party("bob").remote()
Expand Down

0 comments on commit b593eb7

Please sign in to comment.