photostructure / batch-cluster.js

Parallelized and efficient Node.js support for batch-mode child processes
https://photostructure.github.io/batch-cluster.js/
MIT License
14 stars 3 forks source link

Processes not handled properly if ps command not present #13

Closed rubiesonthesky closed 3 years ago

rubiesonthesky commented 3 years ago

This concers exiftool-vendored usage but the problem is coming from this library.

When using exiftool-vendored in minimized Docker image, for example, Debian slim, processed are not killed / terminated correctly because ps command is not found. procps is not by default installed on slim version.

  1. Is there any way to add support for systems that do not have access to ps command? Propably unlikely.
  2. Could there be some warning printed or debug command to check if ps is missing?
  3. Could this requirement be documented clearly here and other libraries that are using this library, namely exiftool-vendored?

I'm sure I will not be only one having this issue where processes are just spawned with every task invocation and then reported "dead" because this library can't get their pid. Using minimized / slim Docker images is the recommendation and you wouldn't think that using node library is depending having ps command available :) After adding procps to my Docker image, things are working as they should be / same manner as my local dev environment.

mceachen commented 3 years ago

Interesting: I've always run this in a docker container that had installed procps. TBH, I'd never even considered ps not being available on a POSIX system!

I'll put a warning on this package and exiftool-vendored for now. If you want to take a stab at a PR, we can reopen this issue and I'd be happy to review it.