Re: [RESEND] proc, coredump: add CoreDumping flag to /proc/pid/status

From: Roman Gushchin
Date: Fri Sep 22 2017 - 13:18:53 EST


On Fri, Sep 22, 2017 at 06:44:12PM +0300, Konstantin Khlebnikov wrote:
> On Thu, Sep 21, 2017 at 2:06 AM, Roman Gushchin <guro@xxxxxx> wrote:
> > Right now there is no convenient way to check if a process is being
> > coredumped at the moment.
> >
> > It might be necessary to recognize such state to prevent killing
> > the process and getting a broken coredump.
> > Writing a large core might take significant time, and the process
> > is unresponsive during it, so it might be killed by timeout,
> > if another process is monitoring and killing/restarting
> > hanging tasks.
> >
> > To provide an ability to detect if a process is in the state of
> > being coreduped, we can expose a boolean CoreDumping flag
> > in /proc/pid/status.
>
> Makes sense.
>
> Maybe print this line only when task actually makes dump?

I don't think we do this trick with any other fields...

> And probably expose pid of coredump helper.

It will be racy in most cases, so I'm not sure it worth it.
What's the usecase?
In any case, it sounds like a separate feature.

>
> Add Oleg into CC.

Thank you!