Skip to content

Commit b35653d

Browse files
committed
Improvements in logging failures of auto-environments
- Environment failure is reported as an Error, not Warn - we simplify "MesosCommand_Transition timed out for task 2xhyfnmHttq" to "Transition timed out", so the full error is more readable. For examplewq "Transition canceled with error: CONFIGURE could not complete for critical tasks, errors: task 'readout' on alio2-cr1-mvs03 (id 2y3E83DDK6E) failed with error: Transition timed out; task 'stfb' on alio2-cr1-mvs03 (id 2y3E83DDeaA) failed with error: Transition timed out; task 'stfs' on alio2-cr1-mvs03 (id 2y3E83DDz46) failed with error: Transition timed out" Closes OCTRL-1059.
1 parent fee4e34 commit b35653d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/controlcommands/mesoscommandservent.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ package controlcommands
2626

2727
import (
2828
"fmt"
29+
"strings"
2930
"sync"
3031
"time"
3132

@@ -144,7 +145,8 @@ func (s *Servent) RunCommand(cmd MesosCommand, receiver MesosCommandTarget) (Mes
144145
// By the time we get here, ProcessResponse should have already added a Response to the
145146
// pending call, and removed it from servent.pending.
146147
case <-time.After(cmd.GetResponseTimeout()):
147-
call.Error = fmt.Errorf("%s timed out for task %s", cmd.GetName(), receiver.TaskId.Value)
148+
userFriendlyCommandName, _ := strings.CutPrefix(cmd.GetName(), "MesosCommand_")
149+
call.Error = fmt.Errorf("%s timed out", userFriendlyCommandName)
148150

149151
log.WithPrefix("servent").
150152
WithField("partition", cmd.GetEnvironmentId().String()).

core/environment/manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string]
487487
log.WithField("state", envState).
488488
WithField("partition", env.Id().String()).
489489
WithError(err).
490-
Warnf("auto-transitioning environment failed %s, cleanup in progress", op)
490+
Errorf("auto-transitioning environment failed %s, cleanup in progress", op)
491491

492492
the.EventWriterWithTopic(topic.Environment).WriteEvent(
493493
NewEnvGoErrorEvent(env, fmt.Sprintf("%s failed: %v", op, err)),
@@ -1460,7 +1460,7 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str
14601460
log.WithField("state", envState).
14611461
WithField("partition", env.Id().String()).
14621462
WithError(err).
1463-
Warnf("auto-transitioning environment failed %s, cleanup in progress", op)
1463+
Errorf("auto-transitioning environment failed %s, cleanup in progress", op)
14641464

14651465
the.EventWriterWithTopic(topic.Environment).WriteEvent(
14661466
NewEnvGoErrorEvent(env, fmt.Sprintf("%s failed: %v", op, err)),

0 commit comments

Comments
 (0)