Leon4gr45 commited on
Commit
f71b889
·
verified ·
1 Parent(s): 6350e74

Debug child instance logs (part 2)

Browse files
pinchtab/internal/orchestrator/health.go CHANGED
@@ -93,7 +93,10 @@ func (o *Orchestrator) monitor(inst *InstanceInternal) {
93
  inst.Error += " | " + tail
94
  }
95
  eventType = "instance.error"
96
- slog.Error("instance exited before ready", "id", inst.ID)
 
 
 
97
  } else {
98
  inst.Status = "error"
99
  inst.Error = fmt.Errorf("health check timeout after %s (%s)", instanceStartupTimeout, lastProbe).Error()
@@ -101,7 +104,10 @@ func (o *Orchestrator) monitor(inst *InstanceInternal) {
101
  inst.Error += " | " + tail
102
  }
103
  eventType = "instance.error"
104
- slog.Error("instance failed to start", "id", inst.ID)
 
 
 
105
  }
106
  }
107
  instCopy := inst.Instance
 
93
  inst.Error += " | " + tail
94
  }
95
  eventType = "instance.error"
96
+ slog.Error("instance exited before ready", "id", inst.ID, "error", inst.Error)
97
+ if inst.logBuf != nil {
98
+ fmt.Printf("Child instance %s exited early logs:\n%s\n", inst.ID, inst.logBuf.String())
99
+ }
100
  } else {
101
  inst.Status = "error"
102
  inst.Error = fmt.Errorf("health check timeout after %s (%s)", instanceStartupTimeout, lastProbe).Error()
 
104
  inst.Error += " | " + tail
105
  }
106
  eventType = "instance.error"
107
+ slog.Error("instance failed to start", "id", inst.ID, "error", inst.Error)
108
+ if inst.logBuf != nil {
109
+ fmt.Printf("Child instance %s timeout logs:\n%s\n", inst.ID, inst.logBuf.String())
110
+ }
111
  }
112
  }
113
  instCopy := inst.Instance