Skip to content

TLS reloading encounter NPE while testing with multithread #596

@iosmanthus

Description

@iosmanthus

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions