<commit_before>module EventStore
  module Client
    module HTTP
      module Request
        module Retry
          def self.call(connection, max_retries=nil, &blk)
            max_retries ||= self.max_retries

            blk.()

          rescue Errno::EPIPE, Errno::ECONNRESET => error

            retries ||= 0
            retries += 1

            if retries == max_retries
              logger.error "Connection failure (Error: #{error.class.name}, Retries: #{retries}/#{max_retries})"
              raise error
            end

            logger.warn "Connection failure; retrying (Error: #{error.class.name}, Retries: #{retries}/#{max_retries})"
            connection.close
            retry
          end

          def self.logger
            @logger ||= Telemetry::Logger.get self
          end

          def self.max_retries
            3
          end
        end
      end
    end
  end
end
<commit_msg>EOFError is added to list of retry exceptions<commit_after>module EventStore
  module Client
    module HTTP
      module Request
        module Retry
          def self.call(connection, max_retries=nil, &blk)
            max_retries ||= self.max_retries

            blk.()

          rescue Errno::EPIPE, Errno::ECONNRESET, EOFError => error

            retries ||= 0
            retries += 1

            if retries == max_retries
              logger.error "Connection failure (Error: #{error.class.name}, Retries: #{retries}/#{max_retries})"
              raise error
            end

            logger.warn "Connection failure; retrying (Error: #{error.class.name}, Retries: #{retries}/#{max_retries})"
            connection.close
            retry
          end

          def self.logger
            @logger ||= Telemetry::Logger.get self
          end

          def self.max_retries
            3
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08748674443266172, 'fraction_numerical': 0.003181336161187699, 'mean_word_length': 1.5743519781718964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '123657', 'n_tokens_mistral': 523, 'n_tokens_neox': 510, 'n_words': 136}