Reconnecting a replica/sharded client errors

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This showed up in https://github.com/mongodb/mongo-ruby-driver/commit/8d52a17db199a9bf6d7539cb8413008a22f3c0be and happens on the released 1.8.5 version.

      When calling close, thread_local[:managers] is deleted for the client, but is never re-set when connect is called. Which causes the refresh! method to fail when trying to pull max_bson_size and max_message_size.

      Normally, the thread_local[:managers] would just be re-set when a socket is checked out, but since this happens outside of anything being checked out, it's not set in time.

      https://github.com/mongodb/mongo-ruby-driver/pull/186 fixes the issue by making sure it's re-set before refresh! is called, and also adds a test to prevent this from happening again.

              Assignee:
              Emily Stolfo (Inactive)
              Reporter:
              Zachary Anker
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: