Skip to content

Commit

Permalink
init-geth will exit if any client exit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghaven committed Mar 4, 2024
1 parent f73f77f commit aa2505b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion GethNode/init-geth
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,23 @@ def main():
signal.signal(signal.SIGINT, OnTerminate)

# wait for termination
TERMINATE_EVENT.wait()
while not TERMINATE_EVENT.is_set():
if execCltProc is not None and execCltProc.poll() is not None:
raise RuntimeError(
f'Execution client process terminated with code '
f'{execCltProc.returncode}'
)
if consCltProc is not None and consCltProc.poll() is not None:
raise RuntimeError(
f'Consensus client process terminated with code '
f'{consCltProc.returncode}'
)
if valiCltProc is not None and valiCltProc.poll() is not None:
raise RuntimeError(
f'Validator client process terminated with code '
f'{valiCltProc.returncode}'
)
TERMINATE_EVENT.wait(1.0)
finally:
# terminate processes
TerminateProc(consCltProc)
Expand Down

0 comments on commit aa2505b

Please sign in to comment.