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

Upgrade jetcd from 0.5.11 to 0.7.7 makes code pending #1426

Open
cnz101 opened this issue Nov 27, 2024 · 2 comments
Open

Upgrade jetcd from 0.5.11 to 0.7.7 makes code pending #1426

cnz101 opened this issue Nov 27, 2024 · 2 comments

Comments

@cnz101
Copy link

cnz101 commented Nov 27, 2024

Versions

  • etcd: 3.5.4
  • jetcd: 0.7.7
  • java: 1.8

Describe the bug
Jetcd-core-0.7. X changes grpc to vertx, which results in the change from multi-thread to single-thread operation such as add-delete read-write monitor which involves jetcd, it is easy to cause a single-thread exception jam, resulting in process pending.

To Reproduce

@Override
    public Map<String, String> gets(String key) throws EtcdOperationException {
        try {
            GetOption option = getGetOption(key);
            GetResponse response = kvClient().get(EtcdUtils.from(key), option).get();  // pending here
            List<KeyValue> keyValueList = response.getKvs();
            if (CollectionUtils.isEmpty(keyValueList)) {
                return Collections.emptyMap();
            }
            return keyValueList.stream()
                .collect(Collectors.toMap(kv -> EtcdUtils.to(kv.getKey()), kv -> EtcdUtils.to(kv.getValue())));
        } catch (InterruptedException | ExecutionException e) {
            throw new EtcdOperationException(e.getMessage());
        }
    }

Expected behavior
Code "kvClient().get(EtcdUtils.from(key), option).get();" should return value.
Additional context
What should i do ?

@lburgazzoli
Copy link
Collaborator

We have a number of tests that are doing the same thing.

Can you provide a full unit test ?

@cnz101
Copy link
Author

cnz101 commented Dec 12, 2024

This problem was occured in multi-thread environment, here are numerous scenarios in my project that involve reading from and writing to etcd. I guess it related to change grpc to vertx.

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

No branches or pull requests

2 participants