Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Messenger] Use extension_loaded call to check if pcntl extension is loaded, as SIGTERM might be set be swoole #52588

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

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

SerheyDolgushev
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #52586
License MIT

It was assumed. that SIGTERM constant is set only by pcntl PHP extension. But it is also set by swoole. So in some cases SIGTERM might be set when pcntl is disabled but swoole is enabled.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Boo on swoole for this one! :)

@carsonbot carsonbot changed the title Use extension_loaded call to check if pcntl extension is loaded, as SIGTERM might be set be swoole [Messenger] Use extension_loaded call to check if pcntl extension is loaded, as SIGTERM might be set be swoole Nov 14, 2023
@SerheyDolgushev
Copy link
Contributor Author

@derrabus thanks a lot for your patience and help on this case.

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

works for me, but it might be worth to also report this to Swoole

@SerheyDolgushev
Copy link
Contributor Author

works for me, but it might be worth to also report this to Swoole

In theory, there might be other PHP extensions that will set SIGTERM constant. So it is not very accurate to assume that pcntl PHP extension is enabled if SIGTERM is defined. It is much more straightforward and reliable to use extension_loaded for this purpose.

@derrabus
Copy link
Member

Thank you @SerheyDolgushev.

@derrabus derrabus merged commit 4145dee into symfony:6.3 Nov 14, 2023
This was referenced Nov 15, 2023
@fabpot fabpot mentioned this pull request Nov 29, 2023
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.

5 participants