Skip to content

php-fpm: fix Solaris port events.mechanism #9960

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
wants to merge 1 commit into from

Conversation

psumbera
Copy link
Contributor

Closes GH-9959.

@devnexen
Copy link
Member

So I gave a shot at your branch in my illumos instance, looks working to me. cc @bukka

@Girgias Girgias requested a review from bukka November 21, 2022 11:23
@bukka
Copy link
Member

bukka commented Nov 22, 2022

How come this was not noticed during the previous testing? Is that some specific configuration or load that is needed to recreate the issue? Is the issue actually visible when running the tests (without this patch)? If not, we might need to add an extra test for this.

I might need to eventually do some testing myself so will try to setup OpenIndiana sometime soon.

@psumbera
Copy link
Contributor Author

How come this was not noticed during the previous testing? Is that some specific configuration or load that is needed to recreate the issue? Is the issue actually visible when running the tests (without this patch)? If not, we might need to add an extra test for this.

It was my mistake. I didn't really know where the code was used. I just started php-fpm in background and did some testing. To stop it I simply used 'pkill php-fpm'. This killed all php-fpm processes.

Later I realized that some fpm tests were failing. Then I tried to run php-fpm in foreground and used control-c to stop it. It didn't work. Only first event was delivered. But the event about child exiting never was processed...

Now with the change there is no more problems with fpm tests (due still running main php-fpm process).

@bukka
Copy link
Member

bukka commented Nov 22, 2022

Ok makes sense.

I have done some deeper investigation into this and also needed to refresh how the whole thing work in detail. The port is the only one that needs it so I was wondering why. It's actually because it's one-shot only association which is actually confirmed here: https://docs.oracle.com/cd/E86824_01/html/E54766/port-associate-3c.html

When an event for a PORT_SOURCE_FD object is retrieved, the object no longer has an association with the port. The event can be processed without the possibility that another thread can retrieve a subsequent event for the same object. After processing of the file descriptor is completed, the port_associate() function can be called to reassociate the object with the port.

So yeah it needs to be re-associated and this change is correct. Just minor clean up would be great (adding comments for that)

Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

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

If you want the change in PHP-8.0, please address the requested change and quickly re-test it ASAP as we have only 3 days of support there. It would be nice to merge it there as well as it's broken currently. Otherwise it will have to go only to 8.1+

@bukka
Copy link
Member

bukka commented Nov 22, 2022

Merged via 72da2b0 . Thanks!

@bukka bukka closed this Nov 22, 2022
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

Successfully merging this pull request may close these issues.

3 participants