Skip to content

Commit

Permalink
Skip warning when replacing missing fork if supervisor has PID 1
Browse files Browse the repository at this point in the history
As this would usually mean that some process got reparented to the
process with PID 1, and that's why the supervisor doesn't know about it.

Addresses #442
  • Loading branch information
rosa committed Dec 9, 2024
1 parent 979dac1 commit 012e4f8
Showing 1 changed file with 2 additions and 1 deletion.
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

0 comments on commit 012e4f8

Please sign in to comment.