eBay / eBay/sisl

Excessive gRPC Executor Threads Without Resource Quota Limits

Open
#291 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
16
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
5

Description

Problem

During SH testing, a Storage Manager (SM) process exhausted thread resources with 541 threads (normally ~80+). Thread dump analysis shows:

Thread Distribution:

  • 209 threads: grpc_core::Executor::ThreadMain (gRPC's global executor pool, all idle)
  • 246 threads: Empty stack (0x0000000000000000, likely leaked/zombie threads)
  • 32 threads: grpc_threadpool (gRPC internal thread pool)
  • 54 threads: Application threads (folly, nuraft, iomanager, etc.) - normal

AI Analysis - Possible Causes

  1. gRPC executor unbounded growth: gRPC's internal thread pool auto-scales with load but never shrinks. Without ResourceQuota limits, high concurrent RPC calls or connection churn causes accumulation.
  2. Thread lifecycle issue: 246 empty-stack threads suggest cleanup problems, possibly in system libraries (folly/nuraft/boost.asio) or OS-level issues.

Current State

The sisl gRPC wrapper (sisl/src/grpc/rpc_server.cpp:44-79) does not set resource quotas:

  m_builder.SetMaxReceiveMessageSize(max_receive_msg_size);
  m_builder.SetMaxSendMessageSize(max_send_msg_size);
  // Missing: ResourceQuota to limit executor threads

Why Not Fixing Now

  • Root cause unclear: Need to double confirm by human
    -Impact minimal: Pod auto-restarts when hitting limits, no persistent service degradation
  • Optimal limit unknown: Need to determine appropriate MaxThreads value

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with sisl/src/grpc/rpc_server.cpp:44-79 and inspect how the gRPC server builder is configured. Reproduce or confirm the executor and empty-stack thread growth described in the thread dump, then determine an appropriate ResourceQuota MaxThreads value. Done means the root cause is supported by evidence and an actionable limit or follow-up is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.