Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-202

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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0-alpha1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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:
            bjori Hannes Magnusson
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: