Domain socket connection doesn't work with the async driver

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.7.0
    • Component/s: Connection Management
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We are using the async driver. I've installed jnr-unixsocket. Then, just replacing:

      serverAddress = new ServerAddress(host, port);
      

      With:

      serverAddress = new UnixServerAddress("/tmp/mongodb-27017.sock");
      

      Causes:

      com.mongodb.MongoTimeoutException: Timed out after 5000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=/tmp/mongodb-27017.sock, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoInternalException: Opening the AsynchronousSocketChannelStream failed}, caused by {java.lang.UnsupportedOperationException: Cannot return a InetSocketAddress from a UnixServerAddress}}]
      	at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:389)
      	at com.mongodb.connection.BaseCluster.handleServerSelectionRequest(BaseCluster.java:297)
      	at com.mongodb.connection.BaseCluster.access$800(BaseCluster.java:58)
      	at com.mongodb.connection.BaseCluster$WaitQueueHandler.run(BaseCluster.java:470)
      	at java.lang.Thread.run(Thread.java:748)
      

      It says "Cannot return a InetSocketAddress from a UnixServerAddress" which I guess is some bug.

              Assignee:
              Unassigned
              Reporter:
              Boris Petrov
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: