You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am using rq together with prometheus client for metrics exposition. i have the prometheus client in multiprocess mode and i need to call a function (multiprocess.mark_process_dead(pid)) to let it know when a fork has completed so it can perform some necessary cleanup related to the given PID.
my first thought was a custom worker class, but i'm having trouble finding a convenient place to hook into the worker cleanup process that has access to the child's PID.
Hey, sorry for the late reply. You're right, I don't see an obvious place to do this. There are a few places where horse_pid is set to 0 like here https://github.com/rq/rq/blob/master/rq/worker.py#L1335 but this would only work for successful job executions.
I think we'd need to modify the code base a little bit to store worker and horse information in Result object such that it's easily accessible.
i am using rq together with prometheus client for metrics exposition. i have the prometheus client in multiprocess mode and i need to call a function (
multiprocess.mark_process_dead(pid)
) to let it know when a fork has completed so it can perform some necessary cleanup related to the given PID.my first thought was a custom worker class, but i'm having trouble finding a convenient place to hook into the worker cleanup process that has access to the child's PID.
this is where i'm at now:
but i think that's too late in the process as
self.horse_pid
is already set back to 0 by that point.i appreciate any advice you can offer, and thanks for the awesome project!
The text was updated successfully, but these errors were encountered: