Problem/Motivation

During the installation process, and under certain circumstances, two DrupalKernel instances are created. Of course, this slows things down a bit, but more importantly, it can be confusing when debugging as depending on where you are, you don't deal with the same instance of the Kernel, and finally it might lead to unexpected behaviors.

Proposed resolution

The patch reuses the current Kernel instance if it already exists.

CommentFileSizeAuthor
small-optimization.patch891 bytesfabpot
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, small-optimization.patch, failed testing.

fabpot’s picture

Status: Needs work » Needs review

small-optimization.patch queued for re-testing.

Sutharsan’s picture

small-optimization.patch queued for re-testing.

Crell’s picture

This seems reasonable, but I defer to Kat to confirm it won't cause any weird side effects.

... Who isn't in the Assigned list. I'll ping her manually. :-)

katbailey’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine to me.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Cool, thanks for the patch, fabpot!

Committed and pushed to 8.x.

We should get Kat added as a maintainer of something. :)

sun’s picture

Hm.

@fabpot: Could you elaborate a bit more on the "under certain circumstances" bit?

This function is normally executed only once in the installation process and skipped once it was executed. I'm not sure how you were able to execute it more than once (which would be the only situation in which drupal_container() has a regular runtime kernel already, as opposed to the first time, in which the only kernel instance around is a fake/dummy kernel instance with a range of mock/null storage service overrides).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.