Can’t really help, but I think I’ve found the code, in Discourse’s message bus, in function new_subscriber_thread:
if (Time.now - (@last_message || Time.now)) > keepalive_interval * 3
logger.warn "Global messages on #{Process.pid} timed out, restarting process"
# No other clean way to remove this thread, its listening on a socket
# no data is arriving
#
# In production we see this kind of situation ... sometimes ... when there is
# a VRRP failover, or weird networking condition