Thread leak while use ManagedChannel in grpc Java

24 views
Skip to first unread message

Deepak Agarwal

unread,
Jun 19, 2019, 11:52:54 PM6/19/19
to grpc.io
Hi all,
      I am using grpc java as a grpc client to connect to a remote GRPC server. The RPC is a server streaming RPC.
I first build the channel (have not provided customized executor), and then invoke the RPC.

Scenario:
1. I have several destination servers where i have to connect.
2. for one destination, the same RPC can be invoked multiple times (with different parameters)
3. The RPC is server streaming RPC.

What did I do:
1. I created one ManagedChannel(have not provided customized executor) for each destination server.
2. On the same ManagedChannel, i invoke multiple RPCs as and when required, and the RPCs keeps running (server keeps on streaming) until user stops the operation.

Problem:
After few hours, i see there are many threads(in several hundreds) which are spawn by the application and it keeps on increasing with time.

PS: I don't have a thread dump. The thread leak was identified by some external tool in production environment

Carl Mastrangelo

unread,
Jun 24, 2019, 4:22:29 PM6/24/19
to grpc.io
You'll need to include a thread dump to diagnose this further.  
Reply all
Reply to author
Forward
0 new messages