Problem/Motivation

Having assertions active in production incurs a performance loss which will grow over time as assertions are added.

Proposed resolution

Drupal turns them off, but if the setting gets turned on a warning needs to be placed in the report. Also, PHP 7 handles assertions in a more granular method that allows them to be set to not even compile - this is how PHP 7 ships and is the preferred method, but if the setting is changed a notification is required. Unlike PHP 5, PHP 7's zend.assertion directive can't be changed at runtime nor can it be changed in .htaccess, so if it isn't at the default there's no way Drupal can directly effect a change.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task
Issue priority Major because the performance loss will be noticeable if the setting is wrong.
Unfrozen changes Unfrozen - only changes documentation (adding a report)
Prioritized changes Performance
Disruption None

Comments

Aki Tendo created an issue. See original summary.

Aki Tendo’s picture

Status: Active » Needs review
StatusFileSize
new1.67 KB

Note - assert_options(ASSERT_ACTIVE) and ini_get return the same value at all times - there's no way to tell if assertions where activated at run time, by php.ini or by .htaccess.

I would rather deal with the PHP 7 tiger in a later patch.

Status: Needs review » Needs work

The last submitted patch, 2: 2570951.diff, failed testing.

The last submitted patch, 2: 2570951.diff, failed testing.

Aki Tendo’s picture

Why is adding a single status breaking all these tests?

Status: Needs work » Needs review

almaudoh queued 2: 2570951.diff for re-testing.

Status: Needs review » Needs work

The last submitted patch, 2: 2570951.diff, failed testing.

The last submitted patch, 2: 2570951.diff, failed testing.

stefan.r’s picture

Priority: Normal » Major
Issue tags: +Security
StatusFileSize
new1.3 KB
Aki Tendo’s picture

I'd like to finish this ticket out but I'm at a complete loss as to why all those tests are breaking. Is it because I have this checking at install time as well as run?

Also, assertions being turned on shouldn't be a stop on installation - otherwise we won't be able to test any assertions touched during install. So warning, but not a show stop.

almaudoh’s picture

Status: Needs work » Needs review

Sending #9 to testbot

Status: Needs review » Needs work

The last submitted patch, 9: 2570951-6.patch, failed testing.

stefan.r’s picture

I think it'll just show a warning on install - which is fine, it's skippable. We'll just need to set up simpletest to ignore it somehow, or for it not to trigger there.

The last submitted patch, 9: 2570951-6.patch, failed testing.

mr.baileys’s picture

Status: Needs work » Needs review
StatusFileSize
new2.17 KB
new886 bytes

DrupalKernel explicitly enables assertions:

        // Web tests are to be conducted with runtime assertions active.
        assert_options(ASSERT_ACTIVE, TRUE);

I added added a step to InstallerTestBase to continue on the requirements review step. This should get rid of the test failures.

mr.baileys’s picture

StatusFileSize
new2.2 KB

Typo fix/better comment.

The last submitted patch, 15: add_assert_active_to-2570951-15.patch, failed testing.

mr.baileys’s picture

StatusFileSize
new2.85 KB
new664 bytes

Missed one.

The last submitted patch, 16: add_assert_active_to-2570951-16.patch, failed testing.

Aki Tendo’s picture

Status: Needs review » Needs work

"In addition, this feature introduces considerable overhead and performance."

Change to

"In addition, enabling assertions introduces considerable overhead and performance loss."

Otherwise looks good to me.

mr.baileys’s picture

Status: Needs work » Needs review
StatusFileSize
new1.27 KB
new2.86 KB

Changed to wording to the suggestion in #20

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Postponed (maintainer needs more info)

Wonder after 7 years if this is still a valid task? If so will need a reroll and maybe additional changes for D10

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Since there hasn't been a follow up or movement in 7+ years. going to close for now.

If still a valid task please reopen.