Do not expose users to libmongoc's cryptic connection timeout message

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 1.0.0-alpha1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      While testing PHPLIB on Travis CI, I noticed that using "localhost" in a URI instead of "127.0.0.1" leads to a connection timeout:

      MongoDB\Driver\ConnectionException: No stream available for server_id 1
      

      The relevant build is: https://travis-ci.org/jmikola/mongo-php-library-prototype/jobs/55846103

      This message ultimately comes from the FETCH_FAIL case of libmongoc's mongoc_cluster_fetch_stream() function:

      bson_set_error(error,
                     MONGOC_ERROR_STREAM,
                     MONGOC_ERROR_STREAM_NOT_ESTABLISHED,
                     "No stream available for server_id %u", server_id);
      

      We should catch this and use a more user-friendly error message.

              Assignee:
              Hannes Magnusson (Inactive)
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: