Skip to content

Commit 337187a

Browse files
committed
feat: debug test failure
1 parent 0ee21e4 commit 337187a

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

app/models/solid_queue/process.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class SolidQueue::Process < SolidQueue::Record
1111
def self.register(**attributes)
1212
SolidQueue.instrument :register_process, **attributes do |payload|
1313
create!(attributes.merge(last_heartbeat_at: Time.current)).tap do |process|
14+
puts "Registered #{Process.pid} #{$0}"
1415
payload[:process_id] = process.id
1516
end
1617
rescue Exception => error

lib/solid_queue/processes/interruptible.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def wake_up
1010
SELF_PIPE_BLOCK_SIZE = 11
1111

1212
def interrupt
13+
puts "Sending TERM to w: #{self_pipe[:writer].fileno} (r: #{self_pipe[:reader].fileno}) from #{$0}"
1314
self_pipe[:writer].write_nonblock(".")
1415
rescue Errno::EAGAIN, Errno::EINTR
1516
# Ignore writes that would block and retry
@@ -18,6 +19,7 @@ def interrupt
1819
end
1920

2021
def interruptible_sleep(time)
22+
puts "PID #{Process.pid} #{$0} sleeping. waiting on pipe r: #{self_pipe[:reader].fileno} (w: #{self_pipe[:writer].fileno})"
2123
if time > 0 && self_pipe[:reader].wait_readable(time)
2224
loop { self_pipe[:reader].read_nonblock(SELF_PIPE_BLOCK_SIZE) }
2325
end
@@ -30,6 +32,7 @@ def self_pipe
3032
end
3133

3234
def create_self_pipe
35+
puts "Creating pipe for #{$0}"
3336
reader, writer = IO.pipe
3437
{ reader: reader, writer: writer }
3538
end

lib/solid_queue/supervisor/signals.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def handle_signal(signal)
4949

5050
def signal_processes(pids, signal)
5151
pids.each do |pid|
52+
puts "Killing #{pid}" if signal == :QUIT
5253
signal_process pid, signal
5354
end
5455
end

0 commit comments

Comments
 (0)