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

Don't wait forever in TokNext TokMustReply #1871

Merged
merged 1 commit into from
Mar 31, 2020
Merged

Conversation

karknu
Copy link
Contributor

@karknu karknu commented Mar 30, 2020

In the (TokNext TokMustReply) state the responder has indicated that it
currently doesn't have a new tip for us and we should wait.
This patch limits the time we wait to 70s which means that we don't end
up waiting forever incase of network problems.

@karknu karknu requested review from coot and dcoutts March 30, 2020 07:57
@karknu karknu force-pushed the karknu/chain_wait branch from dd9b161 to c7e7c52 Compare March 31, 2020 09:20
@karknu karknu requested a review from mrBliss March 31, 2020 09:22
Copy link
Contributor

@mrBliss mrBliss left a comment

Choose a reason for hiding this comment

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

I'd like to find out what really happens, though.

In the (TokNext TokMustReply) state the responder has indicated that it
currently doesn't have a new tip for us and we should wait.
This patch limits the time we wait to 70s which means that we don't end
up waiting forever incase of network problems.

This is implemented in the form of a parameter to timeLimitsChainSync in
order to get around troublesome testcases in ouroboros-consensus-mock
which don't handle any reasonable timeouts.
@karknu karknu force-pushed the karknu/chain_wait branch from 89dd544 to 3786275 Compare March 31, 2020 11:11
Copy link
Contributor

@dcoutts dcoutts left a comment

Choose a reason for hiding this comment

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

LGTM.

@dcoutts
Copy link
Contributor

dcoutts commented Mar 31, 2020

bors merge

@@ -209,6 +209,8 @@ run tracers protocolTracers chainDbTracer diffusionTracers diffusionArguments
nodeKernel
protocolTracers
(protocolCodecs (getTopLevelConfig nodeKernel) version)
(Just 70) -- timeout after waiting this long for the next header
-- 70s allows for 3 slots (3 * 20s)
Copy link
Contributor

Choose a reason for hiding this comment

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

3 * 20s /= 70s 😏

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Mar 31, 2020

@iohk-bors iohk-bors bot merged commit 821ef36 into master Mar 31, 2020
@iohk-bors iohk-bors bot deleted the karknu/chain_wait branch March 31, 2020 12:20
iohk-bors bot added a commit to IntersectMBO/cardano-node that referenced this pull request Mar 31, 2020
742: Windows fixes from latest network package r=dcoutts a=dcoutts

- [x] sensible pipe buffer size IntersectMBO/ouroboros-network#1876
- [ ] to more reliably connect to the node with multiple clients simultaneously IntersectMBO/ouroboros-network#1881
- [ ] a fix/workaround for the "DNS getting stuck on the second go on windows" problem IntersectMBO/ouroboros-network#1878
- [x] a timeout in the wait case of chain sync IntersectMBO/ouroboros-network#1871

Co-authored-by: Duncan Coutts <[email protected]>
@vhulchenko-iohk vhulchenko-iohk added this to the S10 2020-04-09 milestone Apr 2, 2020
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.

4 participants