Prevent process pruning while capturing dump. #1059
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 works around an issue where the pruning algorithm in the server endpoint info source will likely prune processes that have active dump operations. Having the runtime produce a dump typically has the runtime stall and not respond to diagnostic pipe commands. Since the pruning algorithm uses the diagnostic pipe to test if the target runtime is still responsive, it will consider these processes as unresponsive and remove them. This has the downstream effect of making it impossible to detect the process in the HTTP API while the dump is in progress, stops collection rules when pruned, and restarts collection rules when the runtime instance reconnects to the listening service.
This change mitigates the situation such that the pruning algorithm will not attempt to prune any process that is undergoing a dump operation. Long term, this logic should be merged with RequestLimitTracker with endpoint registration and the ability to query operation status for a given endpoint and operation type.
closes #1053