how do i get the pid of a minion::job?

Skip to first unread message

Gordon Dollarnanda

Aug 12, 2020, 5:41:27 AM8/12/20
to Mojolicious

I noticed that there is a pid method in minion::job object but it doesnt necessarily return the pid.

I checked minion::job::Pg::backend and there is a mention on pid but nothing concrete.

How does one get the pid for a minion::job object reliably or there wants a strong requirement to expose a pid when minion was written?

Thank you

Gordon Dollarnanda

Aug 12, 2020, 8:20:50 AM8/12/20
to Mojolicious

From what i can tell , i revisited the docs and code in Minion and seems to me that the relationship between jobs and workers is many to many. 

If this is not right, please let me know.


a) when START is called on a given job, it returns a process id.

See "sub start" in

b) STOP and RESTART both send signals to the kernel and they rely on the process id(s).

 How about the case when some jobs that have been scheduled and currently running? They do not have a pid as they were not kick started by calling ->start().

 What I am thinking of is:  We get the pids of workers currently working on the given job we want to kill. .

Note: Use for which we retrieve the workers based on a given job id. From there, we issue kill/stop ( by broadcasting to the minion

  Is there a better solution that this?

Issue:  The issue is such that given the relationship between workers and jobs being many to many, if we got the workers by job id and kill the pids of the workers, killing those workers may also kill other jobs. 

 Can anyone confirm about this issue I raised?

Reply all
Reply to author
0 new messages