Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix next_retry busy waiting on first retry #4192

Merged
merged 4 commits into from
Apr 18, 2024

Commits on Apr 18, 2024

  1. Fix next_retry busy waiting on first retry

    The `next_retry_time` gets populated when a request receives an error
    timeout or any other error, after thatn next_retry would check all
    requests in the queue returns the smallest one, which then gets used to
    move the main loop by creating a Delay
    ```
    futures_timer::Delay::new(instant.saturating_duration_since(Instant::now())).await,
    ```
    
    However when we retry a task for the first time we still keep in the
    queue an mark it as in flight so its next_retry_time would be the oldest
    and it would be small than `now`, so the Delay will always triggers, so
    that would make the main loop essentially busy wait untill we received a
    response for the retry request.
    
    Fix this by excluding the tasks that are already in-flight.
    
    Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
    alexggh committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    665f5ed View commit details
    Browse the repository at this point in the history
  2. Update polkadot/node/network/statement-distribution/src/v2/requests.rs

    Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>
    alexggh and sandreim authored Apr 18, 2024
    Configuration menu
    Copy the full SHA
    1b7e282 View commit details
    Browse the repository at this point in the history
  3. Address review feedback

    Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
    alexggh committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    a64bf77 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6871b51 View commit details
    Browse the repository at this point in the history