Class: DRb::DRbTCPSocket

Inherits:
Object
  • Object
show all
Defined in:
lib/distrib_core/core_ext/drb_tcp_socket.rb

Overview

The following monkey-patch sets much lower value for connection timeout By default it is over 2 minutes and it is causing a major worker shutdown delay when the leader has finished already.

Class Method Summary collapse

Class Method Details

.open(uri, config) ⇒ Object

Parameters:

  • uri (String)
  • config (Hash)


11
12
13
14
15
16
17
18
# File 'lib/distrib_core/core_ext/drb_tcp_socket.rb', line 11

def self.open(uri, config)
  host, port, = parse_uri(uri)
  # Original line was:
  # soc = TCPSocket.open(host, port)
  timeout = DistribCore.configuration.drb_tcp_socket_connection_timeout
  soc = Socket.tcp(host, port, connect_timeout: timeout)
  new(uri, soc, config)
end