🐛 remove dead providers from coordinator #4010
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.
This should minimize the impact of errors we have observed with the scan API. If a provider crashes, it doesn't get properly cleaned up and results in endless loop of failed scans because no provider instance is available. This change makes sure we remove dead providers after each scan, such that the next scan can start with a fresh provider.
This still has the issue that if we have 1 scan with 300 assets and the provider crashes after scanning the first asset, we will get 299 errors for the remaining assets. The issue should be gone with the next scan. A better approach is to detect that a provider instance is dead before connecting to it, if that is the case, we should implement restart logic. That should happen inside the runtime, since we keep a reference to the
RunningProvider
in all the runtimes for every asset of the scan. We need to make sure we update the sameRunningProvider
pointer with a new provider instance.I added a TODO to the code where I think this logic should be implemented.