mirror of https://github.com/docker/buildx.git
debug: print error message on monitor instead of processes pkg
This can catch and print more errors on monitor side not only process-related errors. Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
parent
267e30a19c
commit
14834e6085
|
@ -137,11 +137,7 @@ func (m *Manager) StartProcess(pid string, resultCtx *build.ResultHandle, cfg *p
|
||||||
go func() {
|
go func() {
|
||||||
var err error
|
var err error
|
||||||
if err = ctr.Exec(ctx, cfg, in.Stdin, in.Stdout, in.Stderr); err != nil {
|
if err = ctr.Exec(ctx, cfg, in.Stdin, in.Stdout, in.Stderr); err != nil {
|
||||||
if errors.Is(err, context.Canceled) {
|
logrus.Debugf("process error: %v", err)
|
||||||
logrus.Debugf("process canceled: %v", err)
|
|
||||||
} else {
|
|
||||||
logrus.Errorf("failed to exec process: %v", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
logrus.Debugf("finished process %s %v", pid, cfg.Entrypoint)
|
logrus.Debugf("finished process %s %v", pid, cfg.Entrypoint)
|
||||||
m.processes.Delete(pid)
|
m.processes.Delete(pid)
|
||||||
|
|
|
@ -302,7 +302,11 @@ func (m *monitor) startInvoke(ctx context.Context, pid string, cfg controllerapi
|
||||||
go func() {
|
go func() {
|
||||||
// Start a new invoke
|
// Start a new invoke
|
||||||
if err := m.invoke(ctx, pid, cfg); err != nil {
|
if err := m.invoke(ctx, pid, cfg); err != nil {
|
||||||
logrus.Debugf("invoke error: %v", err)
|
if errors.Is(err, context.Canceled) {
|
||||||
|
logrus.Debugf("process canceled: %v", err)
|
||||||
|
} else {
|
||||||
|
logrus.Errorf("invoke: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if pid == m.attachedPid.Load() {
|
if pid == m.attachedPid.Load() {
|
||||||
m.attachedPid.Store("")
|
m.attachedPid.Store("")
|
||||||
|
|
Loading…
Reference in New Issue