jetcd icon indicating copy to clipboard operation
jetcd copied to clipboard

IPv6 support?

Open rkujawa opened this issue 8 years ago • 6 comments

Hi, does jetcd support IPv6?

I keep getting the following exception in my application:

Oct 10 12:08:59 host.platform.linker.shop server[25449]: com.coreos.jetcd.exception.EtcdException: Unable to resolve endpoints [http://lb3.infra.linker.shop:2379/]
Oct 10 12:08:59 host.platform.linker.shop server[25449]: at com.coreos.jetcd.exception.EtcdExceptionFactory.newEtcdException(EtcdExceptionFactory.java:30)
Oct 10 12:08:59 host.platform.linker.shop server[25449]: at com.coreos.jetcd.resolver.SmartNameResolver.doResolve(SmartNameResolver.java:135)
Oct 10 12:08:59 host.platform.linker.shop server[25449]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Oct 10 12:08:59 host.platform.linker.shop server[25449]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Oct 10 12:08:59 host.platform.linker.shop server[25449]: at java.lang.Thread.run(Thread.java:748)

The hostname specified in URL is correct and OS itself can resolve it, though it does only resolve to IPv6 address (by design). It also works correctly if I use plain etcdctl, like:

# etcdctl --endpoint=http://lb3.infra.linker.shop:2379 ls

rkujawa avatar Oct 10 '18 10:10 rkujawa

does jetcd support IPv6?

from what you are reporting, looks like it does not... :smile_cat:

If you wanted to debug this and make contributions (Pull Requests) which fixes this up, that would be certainly be most welcome, and I would be very happy to review and merge work in that area. If I had to guess, I'd imagine some code somewhere is wrongly hard-coded to turning String into (only) IPv4 java.net.InetAddress - kind of thing.

vorburger avatar Oct 10 '18 10:10 vorburger

Thanks for quick reply. I've already skimmed through the resolver code and on a first sight it looks okay. I've only seen InetSocketAddress and SocketAddress used in jetcd. As far as I know, these should support IPv6 out of the box. I'll try to arrange some time to further look into this, but can't promise anything.

rkujawa avatar Oct 10 '18 12:10 rkujawa

@rkujawa Is it possible you could post more information related? I'm having trouble reproducing the issue.

OwlHaus avatar Nov 09 '18 16:11 OwlHaus

It is possible that the issue does not exist anymore - I forgot to add rather important detail, that this was on jetcd v0.0.1.

I've yet to try using newer release (or maybe build jetcd from source), as I didn't have the time to get back to this issue.

rkujawa avatar Nov 09 '18 21:11 rkujawa

@rkujawa let me know if jetcd 0.3.0 solves this issue.

fanminshi avatar Feb 26 '19 06:02 fanminshi

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 21 '20 00:02 github-actions[bot]