Skip to content

Commit

Permalink
Kill two times when stop ibfrun
Browse files Browse the repository at this point in the history
  • Loading branch information
bichengying committed Feb 24, 2021
1 parent 85087f9 commit 44352da
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions bluefog/run/interactive_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _disable_heart_beatcheck(profile):
return True
except:
return False

def _delete_ipengine_config(profile):
config_file = os.path.join(_get_ip_file_dir(
profile), "..", "ipengine_config.py")
Expand Down Expand Up @@ -202,7 +202,8 @@ def _maybe_kill_ipcontroller_process(profile):
"Maybe it is already been stopped.")
return False
try:
os.kill(pid, signal.SIGINT)
for _ in range(2): # Kill two times
os.kill(pid, signal.SIGINT)
return True
except:
return False
Expand All @@ -214,11 +215,13 @@ def _maybe_kill_ipengine_processes(profile):
engine_pids = _get_ipengine_pid_from_file(profile)
if engine_pids is None:
return
for _, pid in engine_pids.items():
try:
os.kill(pid, signal.SIGINT)
except:
pass
for _ in range(2): # Kill two times
for _, pid in engine_pids.items():
try:
os.kill(pid, signal.SIGINT)
except:
pass

_delete_ipengine_config(profile)
_delete_ipengine_pid(profile)

Expand Down

0 comments on commit 44352da

Please sign in to comment.