pinpoint-apm / pinpoint-apm/pinpoint-cpp-agent

Add exponential backoff jitter to gRPC channel readiness

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

Nobody has claimed this yet.

Dominant language
C++
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Background

C++ agent gRPC reconnect behavior currently relies on fixed channel readiness waits. When collectors are down or restarting, many agents can retry on similar intervals and create a thundering herd risk.

The Java agent mitigates this with ExponentialBackoffReconnectJob using:

  • initialInterval: 3000ms
  • multiplier: 1.2
  • randomizationFactor: 0.3
  • maxInterval: 30000ms

Scope

  • Add a reusable exponential backoff helper with jitter.
  • Apply jittered backoff only in the shared gRPC channel readiness path.
  • Use WaitForStateChange during the backoff window instead of sleeping, with 1s slices.
  • Call readyChannel() before metadata unary RPCs.
  • Reset backoff after the channel becomes ready.
  • Add unit tests for delay growth, cap, reset, jitter bounds, and metadata channel-not-ready behavior.

Validation

  • cmake --build --preset debug-cached
  • ctest --preset debug-cached

Contributor guide

Open the contributing guide

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 at the shared gRPC channel readiness path and inspect readyChannel(), WaitForStateChange, and the metadata unary RPC entry points. Use the Java agent's ExponentialBackoffReconnectJob values as reference, then run the listed CMake build and ctest presets. Done means backoff growth, cap, reset, jitter bounds, and channel-not-ready metadata behavior are covered by unit tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, grpc
Domain
api, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.