Skip to content

Commit 8579030

Browse files
Name the connection pool reaper thread
Naming threads can be helpful for debugging (e.g. getting an overview of what's running with `Thread.list.map(&:name)` or `ps -T -p PID`. We noticed our reaper didn't have a name, so this commit adds one. We've intentionally kept the name short (< 15 characters), since there are platform limitations on the length of the underlying thread name. Co-authored-by: John Hawthorn <[email protected]>
1 parent e3deb75 commit 8579030

File tree

1 file changed

+1
-0
lines changed
  • activerecord/lib/active_record/connection_adapters/abstract/connection_pool

1 file changed

+1
-0
lines changed

activerecord/lib/active_record/connection_adapters/abstract/connection_pool/reaper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def spawn_thread(frequency)
4343
# Advise multi-threaded app servers to ignore this thread for
4444
# the purposes of fork safety warnings
4545
Thread.current.thread_variable_set(:fork_safe, true)
46+
Thread.current.name = "AR Pool Reaper"
4647
running = true
4748
while running
4849
sleep t

0 commit comments

Comments
 (0)