gRPC client: waits longer than ten minutes fail before the deadline

Open Beginner friendly
#1,074 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
c, grpc
Domain
networking

Research direction

Start at grpc_client_wait() in the gRPC client; follow how it computes the per-poll timeout and where the absolute deadline is stored, since the bug is the early -1 return when poll yields 0 before that deadline. Change the loop to keep waiting until the absolute deadline, then add a regression test using a mocked clock or an injectable poll so it runs instantly rather than in ten minutes. Done means a deadline over ten minutes away waits correctly and the new test fails on the old code and passes on the fix.

Written by the indexing model from the issue text.

Description

bug

grpc_client_wait() caps each poll at 600000 ms but returns -1 whenever poll returns 0. For a deadline more than ten minutes away, an idle connection therefore fails after the first ten-minute poll even though the requested deadline has not expired. Continue waiting until the absolute deadline, and add a mocked-clock or injectable-poll regression test so the test does not take ten minutes.

Dominant language
C
Stars
16
Forks
7
Avg merge
4h 17m
Merged PRs (30d)
198

Getting set up

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.

More from c4punks/CWIST

All issues in c4punks/CWIST

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.