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

jetcd run with netty-4.1.101 #1282

Closed
caojiajun opened this issue Dec 6, 2023 · 7 comments
Closed

jetcd run with netty-4.1.101 #1282

caojiajun opened this issue Dec 6, 2023 · 7 comments

Comments

@caojiajun
Copy link

Versions

  • etcd: 3.5
  • jetcd: 0.7.6
  • java: 1.8

Describe the bug
jetcd watch function invalid when I upgrade netty to 4.1.101, but 4.1.100 works well

@primabrucexu
Copy link

I found this discuss in grpc, they have fix this. @caojiajun
grpc/grpc-java#10663

@lburgazzoli
Copy link
Collaborator

@caojiajun @primabrucexu can you try with jetcd 0.7.7 ?

@liangyuanpeng
Copy link
Contributor

/assign

I will check it.

@liangyuanpeng
Copy link
Contributor

@primabrucexu @lburgazzoli @caojiajun

I have confirm that 0.7.7 is working for it.

  1. reproduce it, working with jetcd 0.7.6 and netty 4.1.101.Final. Test case will failed.
  2. check jetcd 0.7.7 and test case successed.
   @Test
    public void testWatch() throws InterruptedException {
        String prefix = "/";
        ClientBuilder clientBuilder = Client.builder()
                .endpoints("http://192.168.3.87:2379");
        Client client = clientBuilder.build();

        AtomicBoolean haveWatch = new AtomicBoolean(false);
        Watch.Watcher watcher = client.getWatchClient().watch(ByteSequence.from(prefix.getBytes()),
                WatchOption.newBuilder().isPrefix(true).withPrevKV(true).build(),
                new Watch.Listener() {
                    @Override
                    public void onNext(WatchResponse watchResponse) {
                        haveWatch.set(true);
                    }

                    @Override
                    public void onError(Throwable throwable) {
                    }

                    @Override
                    public void onCompleted() {
                    }
                });

        KV kvClient = client.getKVClient();
        kvClient.put(ByteSequence.from("/hello", Charset.defaultCharset()),ByteSequence.from("world", Charset.defaultCharset())).join();

        TimeUnit.SECONDS.sleep(2);
        Assertions.assertTrue(haveWatch.get());
        watcher.close();
        kvClient.close();
        client.close();
    }

@primabrucexu
Copy link

I manually upgraded the grpc and it worked

@caojiajun
Copy link
Author

it worked after upgrade to netty-4.1.106 and jetcd-0.7.7

@liangyuanpeng
Copy link
Contributor

@caojiajun cool, so this issue should be closed?

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

No branches or pull requests

4 participants