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

if node failed and exited, need relaunch on heartbeat timeout #1420

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dlrover/python/master/node/dist_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def _get_dead_node_event(self, window_interval=600) -> List[NodeEvent]:
and node.start_time
and node.create_time
and node.status == NodeStatus.RUNNING
and not node.is_exited_reported()
and not node.is_succeeded_and_exited()
):
if (
node.heartbeat_time <= node.start_time.timestamp()
Expand Down
15 changes: 15 additions & 0 deletions dlrover/python/tests/test_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,21 @@ def test_get_dead_node_event(self):
events = manager._get_dead_node_event()
self.assertEqual(len(events), 0)

job_nodes = self.job_context.job_nodes()
for index, node in enumerate(job_nodes[NodeType.WORKER].values()):
node.status = NodeStatus.RUNNING
now = datetime.now()
node.heartbeat_time = (now - timedelta(seconds=1000)).timestamp()
if index == 0:
node.reported_status = NodeEventType.SUCCEEDED_EXITED
else:
node.reported_status = NodeEventType.FAILED_EXITED
node.create_time = now - timedelta(seconds=1400)
node.start_time = now - timedelta(seconds=1200)
self.job_context.update_job_node(node)
events = manager._get_dead_node_event()
self.assertEqual(len(events), 2)

def test_relaunch_training_master(self):
params = MockK8sPSJobArgs()
params.initilize()
Expand Down
Loading