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

TLS reloading encounter NPE while testing with multithread #596

Closed
iosmanthus opened this issue Apr 22, 2022 · 0 comments · Fixed by #597
Closed

TLS reloading encounter NPE while testing with multithread #596

iosmanthus opened this issue Apr 22, 2022 · 0 comments · Fixed by #597
Labels
type/bug Something isn't working

Comments

@iosmanthus
Copy link
Member

Bug Report

1. Describe the bug

TLS reloading will produce NPE while getChannel with multiple threads.

2. Minimal reproduce step (Required)

    // Test getChannel concurrently
    factory = new ChannelFactory(v, v, v, v, caPath, clientCertPath, clientKeyPath);

    List<Thread> tasks = new ArrayList<>(8);
    for (int i = 0; i < 8; i++) {
      ChannelFactory finalFactory = factory;
      Thread t = new Thread(() -> finalFactory.getChannel("127.0.0.1:2379", mapping));
      t.start();
      tasks.add(t);
    }

    for (Thread t : tasks) {
      t.join();
    }

3. What did you see instead (Required)

Panic

4. What did you expect to see? (Required)

Test pass

5. What are your Java Client and TiKV versions? (Required)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant