Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

a toaster run leaves orphaned processes #6

Open
tbrowder opened this issue Mar 19, 2018 · 0 comments
Open

a toaster run leaves orphaned processes #6

tbrowder opened this issue Mar 19, 2018 · 0 comments

Comments

@tbrowder
Copy link

tbrowder commented Mar 19, 2018

I’ve looked at Proc::Q and Toaster and I (a concurrency noob) can’t see any obvious leak. However, child processes are being orphaned somehow.

As a temp work around, I might try keeping a list of the proc pids and, after all modules are handled, try to ensure all pids are reaped.

UPDATE

I have just had a successful toaster run with no orphans and I think the culprit in this saga may be me:

Not yet stated is how I’ve been actually executing a run. Since the job is long-running I have been using nohup. After reading about possible problems with stdin I started experimenting with this method:

nohup time perl6 bin/toaster-perl6 > toaster.out 2> toaster.err < /dev/null &

but that apparently blocks use of stdin which the job needs, so I next dropped the stdin redirect:

nohup time perl6 bin/toaster-perl6 > toaster.out 2> toaster.err &

Then, still seeing orphaned processes, I started experimenting with various tweaks to Proc::Q trying to ensure no child processes were being left alive. After many runs, I started looking more closely at the orphan situation (using top and ps ajfx) and decided that nohup may be the root of the problem.

I then rediscovered the at utility, which I haven’t used for many years since leaving a heavy multi-user environment early in my second career. Bingo, no orphans on the first run! Now I have untweaked Proc::Q back to its original form and am trying another run:

I created a one-line script, run-toast.sh, to hold my desired command which is the same as the last nohup line above but without the nohup and the ampersand. Then I executed the file:

at -f run-toast.sh now

and it’s off and running in the default at queue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant