Add one single attempt to reconnect to the Core in case of EventReqestManager disconnection #7747
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.
The connection of EventRequestManager to Core sometimes breaks for unknown reasons. Usually, the broken connection means that the Core process stopped with some error. However, sometimes it seems that the connection can be broken while the Core is still functioning (an example). In this case, the current logic of EventRequestManager does nothing and does not attempt to reconnect.
This PR adds a single attempt to reconnect to the Core. It should be enough in case the connection is broken by accident.
I checked that the PR logic works as expected; it may be non-trivial to write a full test for it.
If the Core truly crashed because of the database corruption error, CoreManager will restart it and reconnect EventRequestManager again.