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

[Merged by Bors] - Fix timing out querying proof in 1:N in presence of a broken Poet #5943

Closed
wants to merge 3 commits into from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented May 15, 2024

Motivation

Description

Moved the context with deadline creation before locking the mutex. This way, all callers have the same timeout, instead of:

  • first: timeout
  • second: 2x timeout
  • third: 3x timeout

💡 It's arguable whether the deadline should be defined in the Proof() method, or by the caller of it. Placing it in the Proof() method is easier to test, hence I kept it there.

Test Plan

Added a test that verifies N concurrent calls to poetClient.Proof() all end within config.RequestTimeout +- <100ms error margin>.

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.8%. Comparing base (898c935) to head (defbfed).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #5943   +/-   ##
=======================================
  Coverage     80.7%   80.8%           
=======================================
  Files          288     288           
  Lines        29894   29894           
=======================================
+ Hits         24147   24157   +10     
+ Misses        4159    4153    -6     
+ Partials      1588    1584    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@fasmat fasmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I also think the caller of Proof should probably set the timeout, but I don't insist on it.

@poszu
Copy link
Contributor Author

poszu commented May 16, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request May 16, 2024
@spacemesh-bors
Copy link

Build failed:

@poszu
Copy link
Contributor Author

poszu commented May 16, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request May 16, 2024
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Fix timing out querying proof in 1:N in presence of a broken Poet [Merged by Bors] - Fix timing out querying proof in 1:N in presence of a broken Poet May 16, 2024
@spacemesh-bors spacemesh-bors bot closed this May 16, 2024
@spacemesh-bors spacemesh-bors bot deleted the fix/timeout-querying-proofs-from-broken-poet branch May 16, 2024 13:51
poszu added a commit that referenced this pull request May 23, 2024
Fix timing out querying proof in 1:N in presence of a broken Poet (#5943)
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.

None yet

2 participants