Skip to content

Threads are not getting cleaned up after processor stops #385

@pramakrishn

Description

@pramakrishn

Hi, it looks like the threads are not cleaned after the processor stops.

I created 5 different Nakadi clients, each with maxRetryAttempts set to 2 and started the processes. They are made to fail by having another client(another process) use the same subscription. I saw that the onStop() method was called 5 times after processor was shutdown.

When I printed the thread dump after r

for (Thread t : ThreadUtils.getAllThreads()) {
    System.out.println(t.getName() + ", " + t.getState().name());
}

I can see that there are still even after 15mins of processor stopping,
RxComputationThreadPool * 8 threads running ( looks like this is constant and is not increasing by increasing the clients) -
RxSchedulerPurge * 1 ,
RxCachedWorkerPoolEvictor * 1 these threads are still running.

However
OkHttp ConnectionPool * 5 - Each per client
1 Okio Watchdog, 1 OkHttpConnection Pool are getting cleaned up after approx 5mins.

Total 10 threads are not cleaned up.

Here is the output.

RxSchedulerPurge-1, TIMED_WAITING
RxCachedWorkerPoolEvictor-1, TIMED_WAITING
RxComputationThreadPool-3, WAITING
RxComputationThreadPool-4, WAITING
RxComputationThreadPool-5, WAITING
RxComputationThreadPool-1, WAITING
RxComputationThreadPool-2, WAITING
RxComputationThreadPool-6, WAITING
RxComputationThreadPool-7, WAITING
RxComputationThreadPool-8, WAITING

Could you confirm if this is a bug or am I missing something here?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions