Skip to content

Commit

Permalink
internal/envoy: add debugging information if envoy is no longer runni…
Browse files Browse the repository at this point in the history
  • Loading branch information
travisgroth committed Jun 30, 2021
1 parent 9bc5227 commit 2ceaae8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions internal/envoy/envoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,24 @@ func (srv *Server) monitorProcess(ctx context.Context, pid int32) {
Int32("pid", pid).
Msg("envoy: error retrieving subprocess status")
} 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).
Int64("original-creation-time", origCtime).
Int64("new-creation-time", newCtime).
Int64("delta-creation-time", newCtime-origCtime).
Int32("pid", pid).
Msg("envoy: subprocess exited")
}
Expand Down

0 comments on commit 2ceaae8

Please sign in to comment.