[CDK-187]: Aggregator timeout issue #133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While trying to build and aggregate proofs, the aggregator has a for loop, where it waits for the syncronizer to sync up. That loop doesn't have a break point if the context provided by the prover communication channel is canceled, leaving it in the infinite loop state, since it constantly returns the
context canceled
error, and just tries to wait again and again.This PR provides a fix which breakes the infinite loop if the context was canceled.
The main cause of this issue is the context which aggregator uses, which is the one provided by the prover communication channel. If the connection to the prover is lost (the context is canceled), we can end up in the situation where the old channel is still alive and in infinite loop trying to wait for the syncronizer by using the same context.
The fix breaks the loop, returns an error, which will eventually stop the old (closed channel), and the connection can be re-established again.