def check_for_expired_workers
      return unless @socket
      loop do
        IO.select([@socket], nil, nil, 0) or return
        line = @socket.readline
        finish_worker(line.to_i, nil)
      end
    rescue EOFError, Errno::ECONNRESET => e
      @socket = nil
      log "#{e.class.name} while reading from master"
      Process.kill(:QUIT, $$)
    end
def check_for_expired_workers
      return unless @socket
      loop do
        IO.select([@socket], nil, nil, 0) or return
        line = @socket.readline
        finish_worker(line.to_i, nil)
      end
    rescue EOFError, Errno::ECONNRESET => e
      @socket = nil
      log "#{e.class.name} while reading from master"
      Process.kill(:QUIT, $$)
    end
Private: Check if master reports any dead workers.