Skip to content

ext/opcache: minor refactoring (2026-03)#21397

Open
Girgias wants to merge 6 commits intophp:masterfrom
Girgias:opcache-minor-refactoring-2026-03
Open

ext/opcache: minor refactoring (2026-03)#21397
Girgias wants to merge 6 commits intophp:masterfrom
Girgias:opcache-minor-refactoring-2026-03

Conversation

@Girgias
Copy link
Member

@Girgias Girgias commented Mar 9, 2026

Commits should be reviewed in order.

@Girgias Girgias marked this pull request as ready for review March 9, 2026 19:15
@Girgias Girgias requested a review from dstogov as a code owner March 9, 2026 19:15
@Girgias Girgias requested a review from arnaud-lb March 9, 2026 19:15
if (fcntl(lock_file, F_GETLK, &restart_check) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "RestartC: %s (%d)", strerror(errno), errno);
return FAILURE;
return false;
Copy link
Member

Choose a reason for hiding this comment

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

This is a functional change. Previously a non-falsy value was returned.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this should likely return true. It will prevent shm from being used or added to during a restart.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, will fix it but seeing failure I assumed it should be false.

Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

Looks good to me apart from Tim's comment

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

Looks ok to me, apart from the comment made by Tim.

for (i = 0; i < entry->dependencies_count; i++) {
zend_class_entry *ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, 0);
for (uint32_t i = 0; i < entry->dependencies_count; i++) {
const zend_class_entry *dependent_ce = zend_lookup_class_ex(entry->dependencies[i].name, NULL, 0);
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Technically the name dependent_ce indicates a dependency of dependent_ce on ce, rather than the other way around.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you have an idea for a better name? dependency_of_ce maybe?

if (fcntl(lock_file, F_GETLK, &restart_check) == -1) {
zend_accel_error(ACCEL_LOG_DEBUG, "RestartC: %s (%d)", strerror(errno), errno);
return FAILURE;
return false;
Copy link
Member

Choose a reason for hiding this comment

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

Yeah this should likely return true. It will prevent shm from being used or added to during a restart.

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.

4 participants