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

Skip warning when replacing missing fork if supervisor has PID 1 #450

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/solid_queue/log_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def unhandled_signal_error(event)
end

def replace_fork(event)
supervisor_pid = event.payload[:supervisor_pid]
status = event.payload[:status]
attributes = event.payload.slice(:pid).merge \
status: (status.exitstatus || "no exit status set"),
Expand All @@ -155,7 +156,7 @@ def replace_fork(event)

if replaced_fork = event.payload[:fork]
info formatted_event(event, action: "Replaced terminated #{replaced_fork.kind}", **attributes.merge(hostname: replaced_fork.hostname, name: replaced_fork.name))
else
elsif supervisor_pid != 1 # Running Docker, possibly having some processes that have been reparented
warn formatted_event(event, action: "Tried to replace forked process but it had already died", **attributes)
end
end
Expand Down
Loading