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

bitswap/client/messagequeue: expose dontHaveTimeoutMgr configuration #750

Merged
merged 5 commits into from
Dec 13, 2024

Conversation

gammazero
Copy link
Contributor

@gammazero gammazero commented Dec 12, 2024

  • Create an exported DontHaveTimeoutConfig to hold configuration values for dontHaveTimeoutMrg
  • Provide function DefaultDontHaveTimeoutConfig to return a DontHaveTimeoutConfig populated with default values
  • Bitswap client New has new option for caller to supply a DontHaveTimeoutConfig
  • If the required onHaveTimeout function is nil, then disable the dontaHaveTimeoutMgr
  • The option to disable donthavetimeout handling is respected and the dontHaveTimeoutMgr is disabled if this option is false.

This PR replaces #703

Closes #701

Credit to @Wondertan for the original PR #703 that this one is based on.

@gammazero gammazero requested a review from a team as a code owner December 12, 2024 07:44
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 91.34615% with 9 lines in your changes missing coverage. Please review.

Project coverage is 60.38%. Comparing base (058422d) to head (a77036a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...client/internal/messagequeue/donthavetimeoutmgr.go 90.90% 3 Missing and 2 partials ⚠️
bitswap/client/client.go 60.00% 4 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #750      +/-   ##
==========================================
+ Coverage   60.25%   60.38%   +0.12%     
==========================================
  Files         245      245              
  Lines       31081    31115      +34     
==========================================
+ Hits        18729    18788      +59     
+ Misses      10674    10651      -23     
+ Partials     1678     1676       -2     
Files with missing lines Coverage Δ
...tswap/client/internal/messagequeue/messagequeue.go 86.25% <100.00%> (+2.86%) ⬆️
bitswap/client/client.go 86.71% <60.00%> (-3.22%) ⬇️
...client/internal/messagequeue/donthavetimeoutmgr.go 93.98% <90.90%> (+0.71%) ⬆️

... and 7 files with indirect coverage changes

- Create an exported DontHaveTimeoutConfig to hold configuration values for dontHaveTimeoutMrg
- Provide function DefaultDontHaveTimeoutConfig to return a DontHaveTimeoutConfig populated with default valued.
- Bitswap client New has new option for caller to supply a DontHaveTimeoutConfig
- If the required onHaveTimeout function is nil, then disable the dontaHaveTimeoutMgr

update changelog
@gammazero gammazero force-pushed the donthavetimeout-config branch from 25cb9d4 to 1f6f579 Compare December 12, 2024 17:09
CHANGELOG.md Outdated Show resolved Hide resolved
After closer inspection it is not used for anything.  The one passed to
`newDontHaveTimeoutMgr` as a separate argument is used instead.
@gammazero
Copy link
Contributor Author

Thank you for removing the unused value from config, I had forgotten to do that. Everything looks good at this point, so will merge.

@gammazero gammazero merged commit 2a26bf9 into main Dec 13, 2024
15 checks passed
@gammazero gammazero deleted the donthavetimeout-config branch December 13, 2024 22:07
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.

bitswap(messagequeue): Expose DONT_HAVE timeout knobs
2 participants