Giter VIP home page Giter VIP logo

Comments (5)

grondo avatar grondo commented on June 17, 2024 1

The OOM killer will terminate tasks with SIGKILL. If a task exited with wait status indicating this signal, that could trigger a check in the memory.events file, or alternately, if the shell is separately watching the memory.events file via inotify, a flag could be set which would trigger an error message that tasks terminated with SIGKILL may have been victims of the oom killer.

from flux-core.

garlick avatar garlick commented on June 17, 2024

I think the shell (assuming it's not the target of the OOM) can simply do the following

  • get the shell's cgroup root from /proc/<pid>/cgroup (it will contain 0::path, where path is relative to /sys/fs/cgroup)
  • read the oom_kill count from memory.events
  • if nonzero, log something like memory cgroup out of memory: process killed

This could be checked in the shell task.exit callback, although if multiple ranks were killed, I'm not sure if we can reliably conclude that the exiting task was the target of the oom, unless there were some way to retain the task's cgroup memory.events post exit...

from flux-core.

grondo avatar grondo commented on June 17, 2024

I wonder if it would work to use something like inotify or otherwise to watch the memory.events file and report an OOM kill as it happens?

unless there were some way to retain the task's cgroup memory.events post exit...

Is there a separate memory.events per pid?

from flux-core.

garlick avatar garlick commented on June 17, 2024

Is there a separate memory.events per pid?

Yes. I was worried about racy access since the child process is immediately reaped by the libev child watcher, but maybe there is a non racy way to consume all the events via inotify or even just by holding it open and reading it before closing it. Good thought! I'll try some experiments.

from flux-core.

garlick avatar garlick commented on June 17, 2024

Is there a separate memory.events per pid?

Er. I misspoke. The task /proc/<pid>/cgroup points to the same cgroup dir as the shell. (Which makes sense I guess)

from flux-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.