introspection: expose the daemon's PID and PIDNS#7694
introspection: expose the daemon's PID and PIDNS#7694dmcgowan merged 1 commit intocontainerd:mainfrom
Conversation
Signed-off-by: Akihiro Suda <[email protected]>
97375cb to
661aaae
Compare
| } | ||
| pid := os.Getpid() | ||
| var pidns uint64 | ||
| if runtime.GOOS == "linux" { |
There was a problem hiding this comment.
nit: is this if block necessary since you have an (empty) implementation of statPIDNS for all non-Linux platforms?
There was a problem hiding this comment.
Not necessary, but added for readability
| if err != nil { | ||
| return nil, errdefs.ToGRPC(err) | ||
| } | ||
| pid := os.Getpid() |
There was a problem hiding this comment.
I think we don't unshare newpid for the short-live thread. It is safe to do that.
There was a problem hiding this comment.
Sorry for my unclear comment.
I was thinking why not just hide the pid param in the statPIDNS function,
since pid won't change in the entire life-cycle.
And I also consider that the result can be cached when plugin initializes.
But other random thought comes. Is it possible to change containerd's pidns like #7513?
If the pidns changes, we can't cache it. 😂
e.g., for inspecting the daemon's
oom_score_adj