[JAVA-2852] Domain socket connection doesn't work with the async driver Created: 04/May/18 Updated: 27/Oct/23 Resolved: 21/May/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 3.7.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Boris Petrov | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
We are using the async driver. I've installed jnr-unixsocket. Then, just replacing:
With:
Causes:
It says "Cannot return a InetSocketAddress from a UnixServerAddress" which I guess is some bug. |
| Comments |
| Comment by Elan Kugelmass [ 26/Jun/18 ] |
|
jeff.yemin could you elaborate on why the Async driver (when used with Netty) is not compatible with domain sockets? Netty does support Domain Socket Channels. https://github.com/netty/netty/pull/3344 |
| Comment by Jeffrey Yemin [ 21/May/18 ] |
|
Closing as Works as Designed, and linked to issue to improve docs and error handling. |
| Comment by Jeffrey Yemin [ 21/May/18 ] |
|
Linked to JAVA-2864 |
| Comment by Jeffrey Yemin [ 21/May/18 ] |
|
Note: https://github.com/mongodb/mongo-java-driver/commit/a55d172161511132d1be5c6100443065b9444ef2 references this issue but the commit is actually for |
| Comment by Jeffrey Yemin [ 04/May/18 ] |
|
Domain sockets are not supported in the async driver. The implementation relies on jnr-unixsocket, which is essentially a custom socket factory. But the async driver uses java.nio.channels.AsynchronousSocketChannel or, optionally, Netty, neither of which are compatible with domain sockets. We don't intend to support this use case, but we'll look into improving the documentation to make it clear that it's not supported, and failing fast rather than waiting for a timeout exception. |