Skip to content

Commit 012e4f8

Browse files
committed
Skip warning when replacing missing fork if supervisor has PID 1
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
1 parent 979dac1 commit 012e4f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/solid_queue/log_subscriber.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ def unhandled_signal_error(event)
145145
end
146146

147147
def replace_fork(event)
148+
supervisor_pid = event.payload[:supervisor_pid]
148149
status = event.payload[:status]
149150
attributes = event.payload.slice(:pid).merge \
150151
status: (status.exitstatus || "no exit status set"),
@@ -155,7 +156,7 @@ def replace_fork(event)
155156

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

0 commit comments

Comments
 (0)