Skip to content

Conversation

@harp-intel
Copy link
Contributor

This pull request refactors how scripts are executed and managed, replacing the previous parallel execution model with a unified "controller" script approach. It also updates terminology throughout the codebase to use "concurrent" instead of "parallel" for clarity. Additionally, it improves signal handling to ensure robust cleanup of script processes.

Key changes include:

Script Execution Refactor:

  • Replaces the "parallel_master.sh" and associated logic with a unified "controller.sh" script that manages both concurrent and sequential script execution on targets. This simplifies process management and signal handling (internal/script/script.go, internal/common/common.go). [1] [2] [3]
  • Introduces ControllerPIDFileName constant and updates references to use "controller.pid" for process tracking instead of the previous "primary_collection_script.pid". [1] [2]

Signal Handling Improvements:

  • Refactors signal handling logic to send signals directly to the "controller.sh" process on each target, ensuring proper cleanup of child processes. Adds a helper function signalProcessOnTarget to abstract sending signals, and improves timeout/cleanup logic to escalate from SIGINT to SIGKILL if needed. [1] [2] [3]

Terminology and Documentation Updates:

  • Updates comments and variable names throughout the codebase to use "concurrent" instead of "parallel" for script execution, improving clarity and consistency. [1] [2] [3] [4] [5]

These changes collectively streamline script execution and improve reliability, especially in signal handling and process cleanup scenarios.

Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants