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

Skip to content

Docs about PCNTL extension #19006

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

Closed
phansys opened this issue Oct 9, 2023 · 9 comments
Closed

Docs about PCNTL extension #19006

phansys opened this issue Oct 9, 2023 · 9 comments
Labels
hasPR A Pull Request has already been submitted for this issue.

Comments

@phansys
Copy link
Contributor

phansys commented Oct 9, 2023

We have several places where we are using the PCNTL extension. Recently, some PRs were created to check if the functions or constants provided by this extension are available before trying to use them (by instance, symfony/symfony#51791).

Searching in the codebase and the docs, I don't see any clear insight about the requirement for the extension.
Docs:

Composer suggestions:

Additionally, there are some reports about issues generated by containers compiled with different setups between the cli and the other PHP SAPIs, where the cli SAPI was including the extension and the other did not: symfony/symfony#37005.

Considering this sentence in the extension documentation, having the extension enabled only in the cli SAPI seems legit:

Process Control should not be enabled within a web server environment and unexpected results may happen if any Process Control functions are used within a web server environment.

Based on this, I think we should provide clear instructions about how to proceed regarding this extension for the most common use cases.

@alexandre-daubois
Copy link
Member

I tried to add a few things in the doc about it, hope this helps πŸ™‚

@phansys
Copy link
Contributor Author

phansys commented Oct 16, 2023

Hi @alexandre-daubois!
First of all, thank you.

I think this helps, but IMO, we should be clear about our position regarding the extension availability and configuration.

  • We are suggesting to install the extension? If yes, I think we should include it in the suggest section of the related packages.
  • We should provide a guide on how configure the extension regarding the different SAPIs.

WDYT?

@alexandre-daubois
Copy link
Member

alexandre-daubois commented Oct 16, 2023

Adding it to the suggest section is a good idea to me! May I create the PR about it or would you like to do it? πŸ™‚

I'm not sure about the configuration of the extension however. I don't think we'd like to write (and maintain) documentation that belongs to other libraries and packages. It is not related to Symfony directly. This is just my opinion, and I think we should ask @javiereguiluz and @OskarStark on this point πŸ™‚

@phansys
Copy link
Contributor Author

phansys commented Oct 16, 2023

Adding it to the suggest section is a good idea to me! May I create the PR about it or would you like to do it? πŸ™‚

I'll try to provide the PRs today.

I'm not sure about the configuration of the extension however. I don't think we'd like to write (and maintain) documentation that belongs to other libraries and packages. It

I'm not suggesting to write docs about how the extension works, but about the proper configuration in a Symfony app, regarding the potential issues in compiled containers shared between multiple SAPIs.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Oct 16, 2023

Adding it to the suggest section is a good idea to me

For the record, we ruled out "suggest" entries from composer.json files (too much maintenance burden).

@fabpot
Copy link
Member

fabpot commented Oct 16, 2023

Adding it to the suggest section is a good idea to me

For the record, we ruled out "suggest" entries from composer.json files (too much maintenance burden).

It's not just about the maintenance; it's also about the low value those suggestions have.

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Oct 18, 2023
@phansys
Copy link
Contributor Author

phansys commented Oct 18, 2023

@alexandre-daubois, do you think we have chance to prevent the usage of the extension on the web context? See this example.

@alexandre-daubois
Copy link
Member

I'm not sure. The manual states that unexpected behavior may happen "if any Process Control functions are used within a web server environment". Only the usage if discouraged, not the installation of the extension. Also, the PHP setup is often the same between the CLI and the web env so I'm not sure we can really write something about this here πŸ˜•

@wouterj
Copy link
Member

wouterj commented Oct 19, 2023

We've introduced one bug in a single release, which raises awareness of this extension. But I would say it generally shouldn't need such high level of awareness. You only need it, when you need it (i.e. when you rely on process signals).

Symfony takes care of not using signal features when this extension is not available (except for this one case). If anything, we should look into improving our CI to make sure we run a job without the pcntl extension.

Let's get the proposed PR merged πŸ‘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue.
Projects
None yet
Development

No branches or pull requests

6 participants