From 8cd5642245bc9a3b307d933e148c5dd5b508af80 Mon Sep 17 00:00:00 2001 From: forgive_dengkai Date: Mon, 11 Sep 2023 21:09:56 +0800 Subject: [PATCH] fix bug Signed-off-by: forgive_dengkai --- python/eggroll/roll_pair/egg_pair.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/eggroll/roll_pair/egg_pair.py b/python/eggroll/roll_pair/egg_pair.py index 20d5e3ee3..52263f931 100644 --- a/python/eggroll/roll_pair/egg_pair.py +++ b/python/eggroll/roll_pair/egg_pair.py @@ -904,6 +904,9 @@ def serve(args): def exit_gracefully(signum, frame): nonlocal run + if cluster_manager: + myself._status = ProcessorStatus.STOPPED + send_heartbeat(node_manager_client, myself) run = False L.info( f'egg_pair {args.processor_id} at port={port}, transfer_port={transfer_port}, pid={pid} receives signum={signal.getsignal(signum)}, stopping gracefully.') @@ -912,8 +915,8 @@ def exit_gracefully(signum, frame): signal.signal(signal.SIGINT, exit_gracefully) while run: - time.sleep(int(RollPairConfKeys.EGGROLL_ROLLPAIR_EGGPAIR_SERVER_HEARTBEAT_INTERVAL.get())) send_heartbeat(node_manager_client,myself) + time.sleep(int(RollPairConfKeys.EGGROLL_ROLLPAIR_EGGPAIR_SERVER_HEARTBEAT_INTERVAL.get())) L.info(f'sending exit heartbeat to cm') if cluster_manager: