Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2852

Domain socket connection doesn't work with the async driver

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.7.0
    • Connection Management
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            alien Boris Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: