refactor signal handler for improved efficiency when multiple remote targets#608
Merged
harp-intel merged 2 commits intomainfrom Jan 9, 2026
Merged
refactor signal handler for improved efficiency when multiple remote targets#608harp-intel merged 2 commits intomainfrom
harp-intel merged 2 commits intomainfrom
Conversation
…targets Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the signal handler to improve efficiency when handling multiple remote targets by introducing concurrent processing. Previously, the handler sequentially sent signals to each target and then waited for each controller process to exit one by one. The refactored implementation sends signals to all targets and waits for their controllers to exit concurrently using goroutines and a WaitGroup.
Key Changes
- Introduced concurrent processing using goroutines and
sync.WaitGroupto wait for controller processes to exit in parallel - Added PID validation to ensure the retrieved PID is a valid integer before attempting to signal the process
- Improved error messages for clarity and consistency throughout the signal handler
Contributor
|
@harp-intel I've opened a new pull request, #609, to work on those changes. Once the pull request is ready, I'll request review from you. |
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request improves the robustness and clarity of the signal handling logic for cleaning up controller processes in the workflow package. The main changes focus on better error handling, concurrent cleanup of target controllers, and clearer logging.
Signal handling and cleanup improvements:
sync.WaitGroup, improving efficiency and ensuring all controllers are properly cleaned up. [1] [2]Logging and code clarity:
myPidtoperfspectPid.Imports and dependencies:
errors,strconv, andsyncto support improved error handling and concurrency.