Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle case when pid file is never created #117

Open
cjcolvar opened this issue Dec 18, 2022 · 0 comments
Open

Handle case when pid file is never created #117

cjcolvar opened this issue Dec 18, 2022 · 0 comments

Comments

@cjcolvar
Copy link
Member

cjcolvar commented Dec 18, 2022

If processing fails during mediainfo file inspection a pid file is never created. When get_pid returns nil it gets converted to 0 by the call to to_i in running? which will always be true. So the encode will never appear as completed.

def running?(pid)
Process.getpgid pid.to_i
true
rescue Errno::ESRCH
false
end

I found this with an encode in production and worked around the issue by creating a pid file with -1 as its contents.

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

No branches or pull requests

1 participant