disconnect! when a socket error occurs in Connection#dispatch

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.0.0
    • Affects Version/s: 2.0.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      disconnect! is necessary on a Mongo::SocketError, otherwise we'll repeat using a bad connection. The following patch illustrates this.

        class Connection
          def dispatch(messages)
            begin
              write(messages)
              messages.last.replyable? ? read : nil
            rescue Mongo::SocketError => e
              disconnect!
              raise e
            end
          end
        end
      

      Refactoring to avoid rescue/raise would be nice.

              Assignee:
              Durran Jordan
              Reporter:
              Gary Murakami (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: