op-node: reset engine through events #10961
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.
Description
This changes the op-node to reset the engine by:
The old
ResetEngine
function was split as follows:sync.FindSyncStart
call: happens on request eventNote that events are still processed synchronously, so the code won't spawn more reset-error events from the pipeline until the reset has been confirmed. Once we make this async we'll need to hold a lock somewhere that a reset is in progress.
Now it can be composed nicely with the other event derivers.
Tests
The reset code-paths are used in almost every test, and no branching functionality is added, so no new tests.
Metadata
Fix #10958