Problem/Motivation

#2226761: Change all default settings and config to fast/safe production values added the null and memory backends to the container, despite objections from me and catch. This clutters up the container, adding stuff back in for dev only purposes when we are striving for fast default values for this stuff.

Proposed resolution

Remove the null and memory backend definitions from core.services.yml and add these to devel module. This can then easily provide these so a dev env can utilise them

Remaining tasks

User interface changes

None

API changes

Clean up cache backends available out of the box. Delegate to devel module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch’s picture

Yes I think we should only have things in the container we expect to be used. It's a dependency injection container, so it should be for actual dependencies, not things to keep around because you might possibly want one day - that's what self-storage container are for.

#2296457: Use container imports to reduce redundant services would let us keep the stub definitions in core without them actually being included in the runtime container, but just moving them to devel gives us a good starting point at least for developer-only services.

dawehner’s picture

Issue tags: +Novice

I think this should be doable.

undertext’s picture

Assigned: Unassigned » undertext
undertext’s picture

Do not fully understand this task. Should I only remove 'cache.backend.null' and 'cache.backend.memory' definitions and leave actual classes (Drupal\Core\Cache\MemoryBackendFactory, Drupal\Core\Cache\NullBackendFactory) in peace?

damiankloip’s picture

Yes please.

undertext’s picture

undertext’s picture

Status: Active » Needs review
damiankloip’s picture

Sorry, we might also want to do something about:

sites/example.settings.local.php
21:$settings['cache']['bins']['render'] = 'cache.backend.null';
star-szr’s picture

Status: Needs review » Needs work

Needs work for #8.

undertext’s picture

If we will remove
$settings['cache']['bins']['render'] = 'cache.backend.null';

then the default Drupal\Core\Cache\DatabaseBackend will be used.

catch’s picture

That's already the case, example.settings.local.php is just an example.

undertext’s picture

Status: Needs work » Needs review
FileSize
1 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Checked, there is no other instance/usages/mentions of these services.

At some point we could ship with an services.local.yml which could include this null/memory backend again.
Is there some general resistance against that?

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 630b08a and pushed to 8.x. Thanks!

  • alexpott committed 630b08a on 8.0.x
    Issue #2309575 by undertext | damiankloip: Remove the null and memory...
catch’s picture

Berdir’s picture

Hm, I don't get why you want to remove this so much :)

The enabled-by-default render cache is a serious burden if you're doing frontend development in 8.x, that specific example was the most useful part about example.settings.local.php, and now it is no longer documented anywhere *and* you need to provide two files to disable it. Yes, maybe devel will provide that as a setting, but it doesn't yet.

We have 239 services in core.services.yml, there is no way that two trivial, by default unused service definitions are going to have an even remotely measurable impact ;) And IMHO, the DX of having that was more important than "cleanliness" of core.services.yml.

damiankloip’s picture

So what would really be easier is if render caching was not enabled by default. That is something you only really want on a production site IMO. This is an artefact of the "out of the box" speed claims.

Berdir’s picture

That would work for me too, the only problem with that is that it would be more likely that contrib/custom modules would not be tested for that (making conditional changes in view alter/preprocess => must be considered in the cache key). And it would be harder to make sure it works if it's not enabled by default, as for tests, we would have to enable it specifically.

But, how would you do that if not by having the render cache bin default to a null backend, which would then have to exist? Another setting on the performance page after we successfully purged the block cache option from it? That would be hard to get through UX reviews.

joelpittet’s picture

Just noticed this was gone today, it's part of my workflow to turn off render cache so I know what I'm looking at isn't cached also for profiling twig template conversions.

We'll need to update this documentation page with the appropriate way to disable render cache.
https://www.drupal.org/node/1903374

@damiankloip What is the new way to do this now that the null bin is gone?

dawehner’s picture

Once we would have support for a services-local.yml file (using imports) we could provide it inside an example file as well.

damiankloip’s picture

As people will not be happy with this change, I opened #2315613: Add a development.services.yml for development. I think that is a good solution?

EDIT: comments are the wrong way round, but what Daniel mentioned in #21 we were talking about in IRC - yes, totally we can do that down the line!

Wim Leers’s picture

Status: Fixed » Active

This issue has disrupted the workflows of many people. Berdir, joelpittet, tim.plunkett (mentioned in #2315613-14: Add a development.services.yml for development), myself and I'm sure others.

Why was this committed without consulting a wider group of people? This was only tagged "Novice", so it was impossible to discover. Few if any people were pinged to ask for feedback. To make it even worse, this was committed before the suggested alternative is actually available (devel module).
That's rather rude.

I'd like to see this patch reverted. It can be re-committed as part of #2315613: Add a development.services.yml for development, which would prevent breaking people's workflows.

Wim Leers’s picture

Title: Remove the null and memory backend definitions from core.services.yml in favour of devel module providing them instead » [Revert?] Remove the null and memory backend definitions from core.services.yml in favour of devel module providing them instead
Status: Active » Needs review
FileSize
1.12 KB
xjm’s picture

Assigned: undertext » Unassigned
Priority: Normal » Major

Tagging the issue "Novice" doesn't make it less visible; also what else would you tag it with? Whose responsibility is it to ping other people? I don't think there's any rudeness; we can of course revert the change if it needs more discussion or consideration.

xjm’s picture

Issue tags: -Novice

That said it's not novice now. ;)

damiankloip’s picture

Assigned: Unassigned » amitaibu
Issue tags: +Novice

What xjm said. I wouldn't say this is rude. No one has tried to intentionally ruin your day.

Seems almost as easy just to get the other issue done? Just needs some feedback addressing from Tim.

xjm’s picture

Assigned: amitaibu » Unassigned
Issue tags: -Novice

xpost. :)

The alpha is scheduled for tomorrow, so if it is causing problems for people, I do think it makes sense to revert it and then include it with the other issue.

damiankloip’s picture

OK. Either works for me!

tim.plunkett’s picture

Title: [Revert?] Remove the null and memory backend definitions from core.services.yml in favour of devel module providing them instead » [Revert] Remove the null and memory backend definitions from core.services.yml in favour of devel module providing them instead
Status: Needs review » Reviewed & tested by the community

Thanks.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 24: revert-2309575.patch, failed testing.

Status: Needs work » Needs review

tim.plunkett queued 24: revert-2309575.patch for re-testing.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

We were having bot issues before.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Ok, seems like this has screwed with some peoples' workflows, so not a great change to make just before an alpha. I've reverted for now, but we can keep discussing.

Committed and pushed to 8.x.

See you in #2315613: Add a development.services.yml for development.

  • webchick committed fd8f71c on 8.0.x
    Issue #2309575 follow-up by Wim Leers: [Revert] Remove the null and...
Wim Leers’s picture

"Rude" was a poor word choice. My apologies.

I'll help reland this as part of #2315613: Add a development.services.yml for development. I've already rerolled it (because this revert makes it so that that patch no longer applies) and included this patch in it: #2315613-31: Add a development.services.yml for development.

m1r1k’s picture

Issue tags: +#ams2014contest

Status: Fixed » Closed (fixed)

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