Skip to content

Conversation

@jitendra-ky
Copy link

@jitendra-ky jitendra-ky commented Apr 1, 2025

Fix: #154

disclaimer

  • I have added, modified, and removed several logs for debugging purposes.
  • The primary focus of this pull request is to demonstrate my approach to solving issue Workflows are not terminated if errors are detected #154.
  • The states are not properly set to maintainers in the workspace (e.g., storing in file rather than runtime).
  • modifed the stop() method, which might be not good.

This is intentional as the primary goal of this PR is to present the approach. Further modifications may be needed during the review process. Once the logic is accepted, we will refine the PR before merging.

here how I self-review the PR

Reproduce the bug by changing the configuration FeatureFinderMetabo -> masstrace_snr_filtering set to True.
here are the all log.

Before
STARTING WORKFLOW

Number of input mzML files: 4

Detecting features...

Running 4 commands in parallel...

Running command:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Blank.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Blank.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Running command:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Control.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Control.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Running command:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Pool.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Pool.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Running command:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Treatment.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Treatment.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Process finished:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Blank.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Blank.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Total time to run command: 0.11 seconds

Process finished:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Control.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Control.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Total time to run command: 0.11 seconds

Process finished:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Treatment.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Treatment.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Total time to run command: 0.11 seconds

ERRORS OCCURRED:
Trailing text argument(s) '[true]' given. Aborting!



FeatureFinderMetabo -- Assembles metabolite features from centroided (LC-)MS data using the mass trace approach.

Full documentation: http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

Version: 3.3.0 Jan 17 2025, 12:49:22, Revision: 3b43a5c

To cite OpenMS:

 + Pfeuffer, J., Bielow, C., Wein, S. et al.. OpenMS 3 enables reproducible analysis of large-scale mass spectrometry data. Nat Methods (2024). doi:10.1038/s41592-024-02197-7.



Usage:

  FeatureFinderMetabo <options>



This tool has algorithm parameters that are not shown here! Please check the ini file for a detailed description or use the --helphelp option



Options (mandatory options marked with '*'):

  -in <file>*        Centroided mzML file (valid formats: 'mzML')

  -out <file>*       FeatureXML file with metabolite features (valid formats: 'featureXML')

  -out_chrom <file>  Optional mzML file with chromatograms (valid formats: 'mzML')





Common TOPP options:

  -ini <file>        Use the given TOPP INI file

  -threads <n>       Sets the number of threads allowed to be used by the TOPP tool (default: '1')

  -write_ini <file>  Writes the default configuration file

  --help             Shows options

  --helphelp         Shows all options (including advanced)



The following configuration subsections are valid:

 - algorithm   Algorithm parameters section



You can write an example INI file using the '-write_ini' option.

Documentation of subsection parameters can be found in the doxygen documentation or the INIFileEditor.

For more information, please consult the online documentation for this tool:

  - http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

ERRORS OCCURRED:
Trailing text argument(s) '[true]' given. Aborting!



FeatureFinderMetabo -- Assembles metabolite features from centroided (LC-)MS data using the mass trace approach.

Full documentation: http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

Version: 3.3.0 Jan 17 2025, 12:49:22, Revision: 3b43a5c

To cite OpenMS:

 + Pfeuffer, J., Bielow, C., Wein, S. et al.. OpenMS 3 enables reproducible analysis of large-scale mass spectrometry data. Nat Methods (2024). doi:10.1038/s41592-024-02197-7.



Usage:

  FeatureFinderMetabo <options>



This tool has algorithm parameters that are not shown here! Please check the ini file for a detailed description or use the --helphelp option



Options (mandatory options marked with '*'):

  -in <file>*        Centroided mzML file (valid formats: 'mzML')

  -out <file>*       FeatureXML file with metabolite features (valid formats: 'featureXML')

  -out_chrom <file>  Optional mzML file with chromatograms (valid formats: 'mzML')





Common TOPP options:

  -ini <file>        Use the given TOPP INI file

  -threads <n>       Sets the number of threads allowed to be used by the TOPP tool (default: '1')

  -write_ini <file>  Writes the default configuration file

  --help             Shows options

  --helphelp         Shows all options (including advanced)



The following configuration subsections are valid:

 - algorithm   Algorithm parameters section



You can write an example INI file using the '-write_ini' option.

Documentation of subsection parameters can be found in the doxygen documentation or the INIFileEditor.

For more information, please consult the online documentation for this tool:

  - http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

Process finished:
FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Pool.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Pool.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Total time to run command: 0.11 seconds

ERRORS OCCURRED:
Trailing text argument(s) '[true]' given. Aborting!



FeatureFinderMetabo -- Assembles metabolite features from centroided (LC-)MS data using the mass trace approach.

Full documentation: http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

Version: 3.3.0 Jan 17 2025, 12:49:22, Revision: 3b43a5c

To cite OpenMS:

 + Pfeuffer, J., Bielow, C., Wein, S. et al.. OpenMS 3 enables reproducible analysis of large-scale mass spectrometry data. Nat Methods (2024). doi:10.1038/s41592-024-02197-7.



Usage:

  FeatureFinderMetabo <options>



This tool has algorithm parameters that are not shown here! Please check the ini file for a detailed description or use the --helphelp option



Options (mandatory options marked with '*'):

  -in <file>*        Centroided mzML file (valid formats: 'mzML')

  -out <file>*       FeatureXML file with metabolite features (valid formats: 'featureXML')

  -out_chrom <file>  Optional mzML file with chromatograms (valid formats: 'mzML')





Common TOPP options:

  -ini <file>        Use the given TOPP INI file

  -threads <n>       Sets the number of threads allowed to be used by the TOPP tool (default: '1')

  -write_ini <file>  Writes the default configuration file

  --help             Shows options

  --helphelp         Shows all options (including advanced)



The following configuration subsections are valid:

 - algorithm   Algorithm parameters section



You can write an example INI file using the '-write_ini' option.

Documentation of subsection parameters can be found in the doxygen documentation or the INIFileEditor.

For more information, please consult the online documentation for this tool:

  - http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

Total time to run 4 commands: 0.12 seconds

Linking features...

Running command:
FeatureLinkerUnlabeledKD -in ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Blank.featureXML ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Control.featureXML ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Pool.featureXML ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Treatment.featureXML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-linking\feature_matrix.consensusXML -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureLinkerUnlabeledKD.ini
Waiting for command to finish...

Process finished:
FeatureLinkerUnlabeledKD -in ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Blank.featureXML ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Control.featureXML ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Pool.featureXML ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Treatment.featureXML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-linking\feature_matrix.consensusXML -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureLinkerUnlabeledKD.ini
Total time to run command: 0.08 seconds

ERRORS OCCURRED:
Cannot read input file given from parameter '-in'!

Error: File not found (the file '..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Blank.featureXML' could not be found)

Exporting consensus features to pandas DataFrame...

Running command:
python src\python-tools\export_consensus_feature_df.py ..\workspaces-streamlit-template\default\topp-workflow\export_consensus_feature_df.json
Waiting for command to finish...

Process finished:
python src\python-tools\export_consensus_feature_df.py ..\workspaces-streamlit-template\default\topp-workflow\export_consensus_feature_df.json
Total time to run command: 5.89 seconds

ERRORS OCCURRED:
C:\Python312\Lib\site-packages\pyopenms\__init__.py:41: UserWarning: Warning: OPENMS_DATA_PATH environment variable already exists. pyOpenMS will use it (C:\Users\foryo\AppData\Local\OpenMS-3.3.0\share\OpenMS) to locate data in the OpenMS share folder (e.g., the unimod database), instead of the default (C:\Python312\Lib\site-packages\pyopenms\share/OpenMS).

  warnings.warn(

Traceback (most recent call last):

  File "C:\Users\foryo\My Drive\1second_brain\projects\openms\streamlit-template\src\python-tools\export_consensus_feature_df.py", line 40, in <module>

    ConsensusXMLFile().load(params["in"], cm)

  File "pyopenms\\_pyopenms_7.pyx", line 2257, in pyopenms._pyopenms_7.ConsensusXMLFile.load

RuntimeError: the file '..\workspaces-streamlit-template\default\topp-workflow\results\feature-linking\feature_matrix.consensusXML' could not be found

WORKFLOW FINISHED
After
STARTING WORKFLOW

Number of input mzML files: 4

Detecting features...

Running 4 commands in parallel...

Running command:39148 FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Control.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Control.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Running command:20300 FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Pool.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Pool.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Running command:40504 FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Blank.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Blank.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

Running command:36620 FeatureFinderMetabo -in ..\workspaces-streamlit-template\default\topp-workflow\input-files\mzML-files\Treatment.mzML -out ..\workspaces-streamlit-template\default\topp-workflow\results\feature-detection\Treatment.featureXML -algorithm:epd:masstrace_snr_filtering true -ini ..\workspaces-streamlit-template\default\topp-workflow\ini\FeatureFinderMetabo.ini
Waiting for command to finish...

❌ ERRORS OCCURRED:20300 | Trailing text argument(s) '[true]' given. Aborting!



FeatureFinderMetabo -- Assembles metabolite features from centroided (LC-)MS data using the mass trace approach.

Full documentation: http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

Version: 3.3.0 Jan 17 2025, 12:49:22, Revision: 3b43a5c

To cite OpenMS:

 + Pfeuffer, J., Bielow, C., Wein, S. et al.. OpenMS 3 enables reproducible analysis of large-scale mass spectrometry data. Nat Methods (2024). doi:10.1038/s41592-024-02197-7.



Usage:

  FeatureFinderMetabo <options>



This tool has algorithm parameters that are not shown here! Please check the ini file for a detailed description or use the --helphelp option



Options (mandatory options marked with '*'):

  -in <file>*        Centroided mzML file (valid formats: 'mzML')

  -out <file>*       FeatureXML file with metabolite features (valid formats: 'featureXML')

  -out_chrom <file>  Optional mzML file with chromatograms (valid formats: 'mzML')





Common TOPP options:

  -ini <file>        Use the given TOPP INI file

  -threads <n>       Sets the number of threads allowed to be used by the TOPP tool (default: '1')

  -write_ini <file>  Writes the default configuration file

  --help             Shows options

  --helphelp         Shows all options (including advanced)



The following configuration subsections are valid:

 - algorithm   Algorithm parameters section



You can write an example INI file using the '-write_ini' option.

Documentation of subsection parameters can be found in the doxygen documentation or the INIFileEditor.

For more information, please consult the online documentation for this tool:

  - http://www.openms.de/doxygen/release/3.3.0/html/TOPP_FeatureFinderMetabo.html

❌ Process 40504: stopped the executing as in other thread error occurred

🛑 Stopping-196415 all running processes: ['39148', '36620']

❌ Process 36620: stopped the executing as in other thread error occurred

❌ Process 39148: stopped the executing as in other thread error occurred

Stopping-196415 process 39148

Failed-196415 to kill process 39148: [WinError 87] The parameter is incorrect

Stopping-196415 process 36620

Failed-196415 to kill process 36620: [WinError 87] The parameter is incorrect

Workflow stopped.

❌ Stopping the execution as error occurred.

ERROR: Execution error occurred in one of the commands.

when Exrro occur in any thread, of the TOPP execution,
then don't start the next execution.
it will terminated all the threads by terminating the
it process (as direct thread termination is not possible in python).
@coderabbitai
Copy link

coderabbitai bot commented Apr 1, 2025

Walkthrough

This pull request updates the CommandExecutor class by introducing a new state management system that tracks process IDs and error states. The changes reset the error state at the start of command execution, update the state when errors occur, log process IDs and error details, and trigger a termination of processes via an updated stop method. These modifications ensure that the workflow aborts upon encountering an error and logs the relevant event details.

Changes

File Change Summary
src/.../CommandExecutor.py • Added execution_pids list and states dictionary to track command execution details.
• Modified run_multiple_commands to reset & check error state.
• Updated run_command to log errors, set state on error, and call stop.
• Enhanced stop to log termination with a unique identifier.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CE as CommandExecutor
    participant Thread as Command Thread
    User->>CE: run_multiple_commands()
    CE->>Thread: Launch command threads
    alt Error Occurs in a Thread
        Thread-->>CE: Report error (set is_executing_error_occurred)
        CE->>CE: Log error & child PID
        CE->>Thread: Invoke stop() to terminate processes
    end
    CE->>CE: Check error state after threads complete
    alt Error Detected
        CE->>User: Raise exception and log termination
    else No Errors
        CE->>User: Complete execution normally
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Abort workflow upon encountering an error (#154)
Display clear error messages in the log for failed TOPP tools (#154)

Poem

I'm a hopping rabbit, joyful and keen,
With pids and states, I keep the code clean.
No error escapes, no misstep in my dance,
Logging each moment, we seize every chance.
Onward we leap, through workflows we glide –
Coding with clarity, with hops full of pride! 🐰

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jitendra-ky jitendra-ky marked this pull request as ready for review April 1, 2025 13:37
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/workflow/CommandExecutor.py (3)

117-120: Remove unused variable

The variable execution_time is calculated but not used since the log message on line 119 is commented out.

- end_time = time.time()
- execution_time = end_time - start_time
+ end_time = time.time()
🧰 Tools
🪛 Ruff (0.8.2)

117-117: Local variable execution_time is assigned to but never used

Remove assignment to unused variable execution_time

(F841)


218-223: Remove commented-out test code

These commented-out test commands should be removed as they don't contribute to the functionality and could cause confusion.

- # commands = [
-#     ["ping", "127.0.0.1", "-n", "10"],
-#     ["ping", "127.0.0.1", "-n", "10"],
-#     ["ping", "127.0.0.1", "-n", "15"],
-#     ["python", "-c", "import time; time.sleep(3); raise Exception('Simulated Error')"]
-# ]

233-234: Remove commented-out code

These commented-out lines should be removed for code cleanliness.

- # self.logger.log(f"Stopping-{stop_id} all running processes...")
- # pids = [Path(f).stem for f in self.pid_dir.iterdir()]
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2786f9 and 5a7691f.

📒 Files selected for processing (1)
  • src/workflow/CommandExecutor.py (7 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
src/workflow/CommandExecutor.py

117-117: Local variable execution_time is assigned to but never used

Remove assignment to unused variable execution_time

(F841)

🔇 Additional comments (9)
src/workflow/CommandExecutor.py (9)

12-12: LGTM: Import for improved logging in stop method

The addition of randint is used to generate a unique identifier for stop operations in logs, which enhances debugging capabilities.


26-31: Well-designed state management additions

These additions create an effective tracking system for:

  1. Process IDs via execution_pids list
  2. Error states via the states dictionary

This approach aligns perfectly with the PR objective of ensuring workflows terminate properly when errors occur.


51-52: Good practice: Reset error state

Resetting the error state before executing commands ensures a clean slate for each execution run, preventing previous errors from affecting the current execution.


67-70: Key improvement: Error detection and workflow termination

This code directly addresses the core issue by checking for errors after all threads complete and stopping further execution if any errors occurred. The clear error message and exception raising create a proper termination mechanism.


93-96: Enhanced process tracking and logging

Good improvements to:

  1. Include the child process ID in log messages
  2. Track process IDs in the execution_pids list
  3. Format log messages for better readability

These changes make debugging and monitoring workflow execution more effective.

Also applies to: 101-101


108-115: Robust process cleanup and early termination

This code:

  1. Safely removes completed process IDs from tracking
  2. Detects errors in other threads and stops execution early
  3. Provides clear logging about why execution was stopped

These changes help coordinate termination across threads and prevent orphaned processes.


127-132: Effective error state management and process termination

When an error occurs, the code:

  1. Updates the error state
  2. Logs detailed error information with process ID
  3. Calls stop() to terminate all running processes
  4. Logs success for completed commands

This comprehensive approach ensures workflows terminate properly on errors.


232-236: Improved process termination reliability

The updated stop method:

  1. Generates a unique ID for each stop operation
  2. Uses the tracked process IDs instead of scanning directories
  3. Provides detailed logging of which processes are being terminated

This makes process termination more reliable and easier to debug.


239-244: Detailed process termination logging

The enhanced logging during process termination provides clear visibility into:

  1. Which processes are being terminated
  2. Whether termination was successful
  3. Any errors that occurred during termination

This level of detail is valuable for troubleshooting workflow termination issues.

@t0mdavid-m t0mdavid-m self-requested a review April 9, 2025 13:11
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.

Workflows are not terminated if errors are detected

1 participant