Skip to content

Commit fe3a89d

Browse files
committed
document an oddity
1 parent 0e9bbea commit fe3a89d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/sidekiq/component.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def redis(&block)
5757
end
5858

5959
def tid
60+
# We XOR with PID to ensure Thread IDs changes after fork.
61+
# I'm unclear why we don't multiply the two values to better guarantee
62+
# a unique value but it's been this way for quite a while now. #3685
6063
Thread.current["sidekiq_tid"] ||= (Thread.current.object_id ^ ::Process.pid).to_s(36)
6164
end
6265

0 commit comments

Comments
 (0)