Skip to content

Matlab process orphaned when workflow is cancelled #78

@rebeccamccabe

Description

@rebeccamccabe

My matlab process hangs (possibly due to a similar bug as described here matlab-actions/setup-matlab#154, but the reason shouldn't be relevant for this issue), causing the run-command action to run indefinitely.

When I cancel the CI workflow from github, the run-command action does not pass on the cancellation signal, leaving the matlab process orphaned. Since I use a self hosted runner, this prevents the next queued workflow from running on the runner, even when the action has reached its 6 hour timeout and github shows it as cancelled. I would want this action to kill the matlab process when it receives the cancel signal from github.

An AI tool suggested that modifying index.ts to the following would work:

const execOpts = { // env: {...process.env, MW_BATCH_LICENSING_ONLINE:'true'} // Disabled while we work out online licensing kinks }; 

becomes

const controller = new AbortController(); const execOpts = { signal: controller.signal, // 👈 this enables automatic kill on workflow cancel // env: {...process.env, MW_BATCH_LICENSING_ONLINE:'true'} // Disabled while we work out online licensing kinks }; 

but I am not sufficiently familiar with how to build github actions that I feel comfortable testing that change.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions