Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinaecalderon committed Jul 18, 2024
1 parent 05357f8 commit 6d109be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 0 additions & 2 deletions e2e_tests/tests/cluster/test_master_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ def test_master_agent_restart_reattach_recover_experiment(
None,
)

# exp.wait_for_experiment_state(sess, exp_id, bindings.experimentv1State.RUNNING)

# Kill the agent & master
restartable_managed_cluster.kill_agent()
restartable_managed_cluster.kill_master()
Expand Down
21 changes: 10 additions & 11 deletions master/internal/trial.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,17 +747,16 @@ func (t *trial) transition(s model.StateWithReason) error {
InformationalReason: s.InformationalReason,
})
default:
if action, ok := map[model.State]task.AllocationSignal{
model.StoppingCompletedState: task.TerminateAllocation,
model.StoppingCanceledState: task.TerminateAllocation,
model.StoppingKilledState: task.KillAllocation,
model.StoppingErrorState: task.KillAllocation,
}[t.state]; ok {
t.syslog.Infof("decided to %s trial", action)
err := task.DefaultService.Signal(*t.allocationID, action, s.InformationalReason)
if err != nil {
t.syslog.WithError(err).Warnf("could not %s allocation during stop", action)
}
// For StoppingKilled and StoppingErrorState, default to KillAllocation.
action := task.KillAllocation

if (t.state == model.StoppingCompletedState) || (t.state == model.StoppingCanceledState) {
action = task.TerminateAllocation
}

t.syslog.Infof("decided to %s trial", action)
if err := task.DefaultService.Signal(*t.allocationID, action, s.InformationalReason); err != nil {
t.syslog.WithError(err).Warnf("could not %s allocation during stop", action)
}
}
case model.TerminalStates[t.state]:
Expand Down

0 comments on commit 6d109be

Please sign in to comment.