Skip to content

Conversation

bukka
Copy link
Member

@bukka bukka commented Oct 9, 2025

The fix fixes some other races that could result in mixed up copy and nprocs number. It requires creating a copy in a similar way like for request status.

This was not previously used to not impact other requests. However this does not make that much sense as the only thing that impacts it is holding the lock and not waiting for it. It is true that if there was a big contention then the lock would be acquired more often but that can be achieved by using fpm_get_status in loop so it should not make a huge difference hopefully.

…ution

The fix fixes some other races that could result in mixed up copy and
nprocs number. It requires creating a copy in a similar way like for
request status.

This was not previously used to not impact other requests. However this
does not make that much sense as the only thing that impacts it is
holding the lock and not waiting for it. It is true that if there was a
big contention then the lock would be acquired more often but that can
be achieved by using fpm_get_status in loop so it should not make a
huge difference hopefully.
@bukka bukka linked an issue Oct 9, 2025 that may be closed by this pull request
@bukka
Copy link
Member Author

bukka commented Oct 9, 2025

In terms of a test, this is not possible to test in PHP framework but I manage to create a working test in WST which recreates the issue and confirms the fix: https://github.com/wstool/wst-php-fpm/blob/22e7eaa03a315e6d9ce0c07d7fd94a4da8b21d8c/spec/instances/status-get-parallel.yaml

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.

FPM - fpm_status_export_to_zval segfault for parallel execution
1 participant