Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Process] allow to ignore signals when executing a process #53968

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

joelwurtz
Copy link
Contributor

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues
License MIT

This PR allow to a process to ignore signals dispatched by PHP

This can be useful when using symfony messenger where the handler would execute a Process and receives a SIGTERM, actually the handler would fail with a ProcessSignaledException instead of waiting for the handler to terminate and gracefully shutdown.

Please note that ignoring a signal will also disallow to send this signal with the posix_kill function

@carsonbot carsonbot added this to the 7.1 milestone Feb 16, 2024
@joelwurtz joelwurtz force-pushed the feat/ignored-signals branch 2 times, most recently from 91f2c5e to 96ef3a8 Compare February 16, 2024 14:24
@joelwurtz joelwurtz force-pushed the feat/ignored-signals branch from 96ef3a8 to 91bd642 Compare March 7, 2024 09:11
@joelwurtz
Copy link
Contributor Author

I have applied feedback ready for review

@fabpot
Copy link
Member

fabpot commented Apr 5, 2024

@joelwurtz Can you have a look at the remaining minor comments? Thank you.

@joelwurtz joelwurtz force-pushed the feat/ignored-signals branch from 91bd642 to c94151d Compare April 5, 2024 07:14
@joelwurtz
Copy link
Contributor Author

Done, sorry for the delay, should be good to review

@@ -1206,6 +1221,20 @@ public function setOptions(array $options): void
}
}

/**
* Define a list of posix signals that will not be propagated to the process.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Define a list of posix signals that will not be propagated to the process.
* Defines a list of posix signals that will not be propagated to the process.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@fabpot fabpot force-pushed the feat/ignored-signals branch from c94151d to 7bb6ecf Compare April 5, 2024 08:07
@fabpot
Copy link
Member

fabpot commented Apr 5, 2024

Thank you @joelwurtz.

@fabpot fabpot merged commit 4c1d8eb into symfony:7.1 Apr 5, 2024
7 of 10 checks passed
@joelwurtz joelwurtz deleted the feat/ignored-signals branch April 5, 2024 08:36
@fabpot fabpot mentioned this pull request May 2, 2024
nicolas-grekas added a commit that referenced this pull request Feb 5, 2025
This PR was merged into the 7.2 branch.

Discussion
----------

[Process] skip transient test on GitHub Actions

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

same as #59690 for a transient test that was introduced with Symfony 7.1 in #53968

Commits
-------

981236c skip transient test on GitHub Actions
nicolas-grekas added a commit that referenced this pull request Feb 5, 2025
This PR was merged into the 7.2 branch.

Discussion
----------

[Process] skip transient test on GitHub Actions

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

same as #59690 for a transient test that was introduced with Symfony 7.1 in #53968 (#59700 added it to the wrong method 🙈)

Commits
-------

fc8ee6a skip transient test on GitHub Actions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants