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

Terminating a process after its execution does not work correctly #36

Closed
zKoz210 opened this issue May 14, 2023 · 0 comments
Closed

Terminating a process after its execution does not work correctly #36

zKoz210 opened this issue May 14, 2023 · 0 comments

Comments

@zKoz210
Copy link
Contributor

zKoz210 commented May 14, 2023

After PHP 8.2 exit no longer works as a graceful process termination.

I tried to solve the problem in this way by replacing exit with posix_kill(posix_getpid(), SIGKILL); and it started working correctly, but I'm not sure if the result is correct.

This code will perform only 2 tasks and will hang indefinitely waiting for the end of the processes.

Example:

$results = Fork::new()
    ->concurrent(2)
    ->run(
        fn () => 1,
        fn () => 2,
        fn () => 3,
    );

Laravel: 10.10.1
PHP: 8.2.6
OS (Docker): Alpine (3.18.0)

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

No branches or pull requests

1 participant