Project

General

Profile

Bug #2718 ยป drb-handle-fork-2718.patch

jeremyevans0 (Jeremy Evans), 08/27/2019 06:40 PM

View differences:

lib/drb/drb.rb
1209 1209
    def self.open(remote_uri)  # :nodoc:
1210 1210
      begin
1211 1211
        conn = nil
1212
        pid = $$
1212 1213

  
1213 1214
        @mutex.synchronize do
1214 1215
          #FIXME
1215 1216
          new_pool = []
1216 1217
          @pool.each do |c|
1217
            if conn.nil? and c.uri == remote_uri
1218
              conn = c if c.alive?
1218
            if c.pid == pid
1219
              if conn.nil? and c.uri == remote_uri
1220
                conn = c if c.alive?
1221
              else
1222
                new_pool.push c
1223
              end
1219 1224
            else
1220
              new_pool.push c
1225
              c.close
1221 1226
            end
1222 1227
          end
1223 1228
          @pool = new_pool
......
1243 1248

  
1244 1249
    def initialize(remote_uri)  # :nodoc:
1245 1250
      @uri = remote_uri
1251
      @pid = $$
1246 1252
      @protocol = DRbProtocol.open(remote_uri, DRb.config)
1247 1253
    end
1248 1254
    attr_reader :uri  # :nodoc:
1255
    attr_reader :pid  # :nodoc:
1249 1256

  
1250 1257
    def send_message(ref, msg_id, arg, block)  # :nodoc:
1251 1258
      @protocol.send_request(ref, msg_id, arg, block)
1252
-