internal/envoy: add debugging information if envoy is no longer running (#2320)

This commit is contained in:
Travis Groth 2021-06-30 14:18:43 -04:00 committed by GitHub
parent 9bc5227d15
commit 2ceaae8e54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -380,7 +380,24 @@ func (srv *Server) monitorProcess(ctx context.Context, pid int32) {
Int32("pid", pid). Int32("pid", pid).
Msg("envoy: error retrieving subprocess status") Msg("envoy: error retrieving subprocess status")
} else if !running { } else if !running {
origCtime, err := proc.CreateTimeWithContext(ctx)
if err != nil {
log.Error(ctx).Err(err).Msg("envoy: failed to get original creation time")
}
newProc, err := process.NewProcessWithContext(ctx, pid)
if err != nil {
log.Error(ctx).Err(err).Msg("envoy: failed to get new process handle")
}
newCtime, err := newProc.CreateTimeWithContext(ctx)
if err != nil {
log.Error(ctx).Err(err).Msg("envoy: failed to get new creation time")
}
log.Fatal().Err(err). log.Fatal().Err(err).
Int64("original-creation-time", origCtime).
Int64("new-creation-time", newCtime).
Int64("delta-creation-time", newCtime-origCtime).
Int32("pid", pid). Int32("pid", pid).
Msg("envoy: subprocess exited") Msg("envoy: subprocess exited")
} }