Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always get Unknown channel option 'io.netty.channel.epoll.EpollChannelOption#TCP_USER_TIMEOUT' for channel the client try to access etcd server #1429

Open
kxs-nzeng opened this issue Dec 12, 2024 · 5 comments

Comments

@kxs-nzeng
Copy link

kxs-nzeng commented Dec 12, 2024

Versions

  • etcd: 3.5.14-debian-12-r4
  • jetcd: 0.8.3
  • java: jvm 21_

Describe the bug
When the client try to access etcd server in a docker compose with endpoint "http://etcd:2379" , always get error like
Unknown channel option 'io.netty.channel.epoll.EpollChannelOption#TCP_USER_TIMEOUT' for channel '[id: 0x8d9e6cd5]'

grpc-netty version 1.62.2
grpc-netty-shaded version 1.62.2

Based on the full log,
2024-12-13T22:37:37.874Z WARN 1773773 --- [ntloop-thread-0] io.netty.bootstrap.Bootstrap : Unknown channel option 'io.netty.channel.epoll.EpollChannelOption#TCP_USER_TIMEOUT' for channel

Now I suspect when jetcd try to access etcd server, the channel builder try to mix NioEventLoopGroup with EpollSocketChannel. I am on Linux system. Not sure how could it happen and how to resolve it

What I could do to resolve this?

My project is hung now. Very appreciate for any help here.

@ghimi-g
Copy link

ghimi-g commented Dec 28, 2024

at code

// io/etcd/jetcd/impl/ClientConnectionManager.java:219
    Vertx vertx() {
        if (this.vertx == null) {
            synchronized (this.lock) {
                if (this.vertx == null) {
                    this.vertx = Vertx.vertx(new VertxOptions().setUseDaemonThread(true));
                }
            }
        }

        return this.vertx;
    }

Change into this can solve problem

this.vertx = Vertx.vertx(new VertxOptions().setUseDaemonThread(true).setPreferNativeTransport(Utils.isEpollAvailable()))

Utils comes from io.grpc.netty.Utils ,at package io.grpc:grpc-netty,used for determine whether epoll(netty-transport-native-epoll) is available。 Vertex use preferNativeTransport property to decide whether use EpollEventLoopGroup. The default option is false, which cause use NioEventLoopGroup but config EpollChannelOption cause this warning.

If you don't want to see this warning, you can temporarily remove netty-transport-native-epoll package in your project.

Reference

@cnz101
Copy link

cnz101 commented Dec 28, 2024

@ghimi-g hello, Have you ever been in this situation?jetcd get、put、delete operaton blocked and no response. when i use jetcd below 0.7.x, it's ok. but when i upgrade to 0.7.x, this problem happened.
jetcd 0.7.7
etcd v3.5.4
jdk 1.8
image

@lburgazzoli
Copy link
Collaborator

you probably need to check your dependency tree, unfortunately a few things break if the groc and netty deps are not correct

@kxs-nzeng
Copy link
Author

Thank you for all of your reply. Finally the issue seems to be related with the endpoint I provided. My etcd server spin up in a docker compose, therefore the endpoint should use host name return from getServiceHost from docker compose container. Not etcd. The error message is misleading. When I give the correct endpoint, everything is fine now.
Thanks again for everybody's help.

@kxs-nzeng
Copy link
Author

For Question from CNZ101,
I use version 0.8.3.
I could really get response when using code as

public byte[] getValue(String key) throws InterruptedException, ExecutionException {
ByteSequence keyByte = ByteSequence.from(key.getBytes());
GetResponse response = kvClient.get(keyByte).get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants