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: rpcenc: deflake TestReaderRedirectDrop #10406

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Mar 7, 2023

Related Issues

Fixes #10201

Proposed Changes

  • Make the test reproduce the original issue with near ~100% reliability
  • Fix the edge-case
  • Update the test to deal with racy behavior correctly

Additional Info

  • beginPost "transforms" the virtual reader into a real one after the first call to Read
  • TestReaderRedirectDrop tests what happens when the connection from the client to the redirecting node drops juuust before the redirecting node attempts to call a target node with a redirected reader
    • There appears to be a race between the redirected stream being accepted/consumed on the decoding end, and the redirect logic noticing that the stream that we have just tried to redirect was closed.
    • Fixing that would require a lot of hacky instrumentation, so for now the test accepts both, entirely correct, outcomes from the closed to-be-redirected head request.
  • closeOnce needs to be propagated because it's what's guarding nr.res from double-close

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@magik6k magik6k requested a review from a team as a code owner March 7, 2023 15:56
@magik6k magik6k merged commit 9038e83 into master Mar 8, 2023
@magik6k magik6k deleted the fix/rpcenc-falky-test branch March 8, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

itests: TestReaderRedirectDrop is flaky
2 participants