Enforce the API readiness timeout across RPC calls and retry delays

Open
#7,892 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust

Research direction

Start with src/cli/subcommands/wait_api_cmd.rs, where the readiness polling loop, Version RPC, and retry delay are identified. Trace how the loop applies --timeout and preserves the one-second request limit, then add coverage for late success, a failed poll near the deadline, and polling without an overall timeout. Done means each acceptance criterion passes.

Written by the indexing model from the issue text.

Description

Summary

The CLI API readiness command checks --timeout only before each poll in src/cli/subcommands/wait_api_cmd.rs. A Version RPC can return successfully after the timeout expires, and a failed poll can be followed by a retry sleep that extends beyond the timeout.

Required changes

Apply one overall deadline to the polling loop, including each RPC and retry delay. Retain the one-second per-request limit. When --timeout is omitted, continue polling until the API is available.

Acceptance criteria

  • A response received after the overall timeout is not reported as success.
  • A failed RPC and retry delay do not extend the command beyond the overall timeout.
  • Each RPC retains its one-second limit.
  • With no overall timeout, polling continues until success.
  • Tests cover a late successful response, a failed poll and retry delay near the deadline, and the no-timeout behavior.

This behavior predates the duration parser change in the linked pull request.

Requested by @LesnyRumcajs.

Pull request: https://github.com/ChainSafe/forest/pull/7890
Review comment: https://github.com/ChainSafe/forest/pull/7890#discussion_r4614361143

Dominant language
Rust
Stars
700
Forks
201
Avg merge
1d 17h
Merged PRs (30d)
65

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 ChainSafe/forest

All issues in ChainSafe/forest

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.