Since a new StorageDispatcher object for which we don't have a clear purpose was introduced in this issue, #1605324: Configuration system cleanup and rearchitecture, this patch is about simplifying the code by:
- Removing it completely, everything still runs, best proof of that it is not needed at this point, and the code looks much cleaner.
- Simplify building Config objects, since they always need a name, the name should be in the constructor, this one looks quite obvious to me since code is cleaner and saves a few lines.

This should also improve performance and lower memory usage, though I don't have any benchmark, it should be obvious that by creating a Database storage once and reusing it for all the request's config objects, we are saving some logic and a few objects to be created.

That unless we come up with a clear purpose and/or some use for that StorageDispatcher thing, which is not happening atm, see #1624580: Research and implement a proper design for StorageDispatcher

The whole point is: if all our use cases can be rewritten without it and still simplifying the code, why is it there?
In addition to that it is making other intents of plugging into the config system more complex, like #1616594: META: Implement multilingual CMI

Files: 
CommentFileSizeAuthor
#34 config.dispatcher.32.patch14.38 KBsun
PASSED: [[SimpleTest]]: [MySQL] 39,896 pass(es). View
#32 config.dispatcher.32.patch14.38 KBsun
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config.dispatcher.32.patch. Unable to apply patch. See the log in the details link for more information. View
#32 interdiff.txt7.61 KBsun
#25 config-1671080-24.patch11.72 KBGábor Hojtsy
PASSED: [[SimpleTest]]: [MySQL] 39,904 pass(es). View
#21 config-1671080-21.patch11.71 KBGábor Hojtsy
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View
#18 interdiff.txt728 bytesno_commit_credit
#17 config-1671080-17.patch11.92 KBno_commit_credit
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config-1671080-17.patch. Unable to apply patch. See the log in the details link for more information. View
#14 config.dispatcher.14.patch11.97 KBsun
PASSED: [[SimpleTest]]: [MySQL] 37,213 pass(es). View
#12 config.dispatcher.12.patch12.12 KBsun
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config.dispatcher.12.patch. Unable to apply patch. See the log in the details link for more information. View
config-storage_dispatcher-remove.patch9.93 KBJose Reyero
PASSED: [[SimpleTest]]: [MySQL] 37,066 pass(es). View

Comments

Jose Reyero’s picture

Note: the above patch saves exactly 120 lines of code while changing/adding only 28 (maybe counting blank lines, not sure).

Gábor Hojtsy’s picture

Status: Active » Needs review
Jose Reyero’s picture

Moving to 'needs review' for the testbot

sun’s picture

Assigned: Unassigned » heyrocker

if all our use cases can be rewritten without it

The problem (which you want to ignore ;)) is that not all of our use-cases and requirements are implemented yet.

Therefore, it is of course easy to say: "Hey, I can remove this, it's not needed."

IMHO it does not help at all to remove it, before having had an actual discussion on our technical requirements, which is supposed to happen in #1624580: Research and implement a proper design for StorageDispatcher

I'd strongly recommend to postpone this issue on that discussion (or even mark it as duplicate). However, the two of us have a disagreement here :) and I don't have any more say than @Jose.

Therefore, I think it makes most sense to delegate the decision to @heyrocker.

Jose Reyero’s picture

> The problem (which you want to ignore ;)) is that not all of our use-cases and requirements are implemented yet.

What I mean is: Please just give me one and implement it (and I'll see whether I can rewrite it easier without it).

merlinofchaos’s picture

I was involved in the StorageDispatcher discussion and the use-case is legitimate. I agree with sun here that removing it before we have fully established the use cases it was intended for is premature.

heyrocker’s picture

Status: Needs review » Postponed

I agree with sun, I'd like to see the use cases and technical requirements outlined and put forward before we decide whether it is worth continuing or not. We talked about whether to include it or not in the rearchitecture issue, and it appeared to me that everyone said it was my call, and I made it so now that it's in lets see where we're at before pulling it right back out again. I remember a lot of sun's potential use-cases being pretty compelling at Barcelona (although I admit that its now been too long for me to remember the specifics.)

Jose Reyero’s picture

Well, np with 'postponing' it.

This is just a call to either do something useful with StorageDispatcher or consider dropping it for good.

Though I'm serious about rewriting your use cases without StorageDispatcher, looking forward to see one of them ;-)

Thanks for reviewing.

Jose Reyero’s picture

Title: Simplify configuration system, improve performance, by removing useless StorageDispatcher » Simplify configuration system, improve performance, by removing StorageDispatcher

Updating title

sun’s picture

Title: Simplify configuration system, improve performance, by removing StorageDispatcher » Remove StorageDispatcher to simplify configuration system

#1624580: Research and implement a proper design for StorageDispatcher is where we need to have this discussion. It would be great if everyone would jump on that issue and check the requirements/use-cases that have been written down already, and also think about their own and new ones. :)

That said, I'm not sure whether the discussion in #1605324: Configuration system cleanup and rearchitecture contained further use-case examples. It think that most of the discussion was around "we don't know yet, so we better keep it", but we should double-check that.

Lastly, I will say that I'm already thinking about how the currently noted requirements can be resolved in combination with this issue.

Also improving this issue title, and removing the performance aspect, because I'm pretty sure that you will not be able to do a benchmark that shows a performance difference due to this change.

Jose Reyero’s picture

@sun,
Ok with the renaming, etc...

However about the discussion, since the thing is already in, I think the most important issue would be to give it some use and see how it looks like.

Really, I'll be having a ton of patches in the queue (for the D8MI thing) and StorageDispatcher is just sitting in the middle of most of them. We really need to know how it is going to work to make any progress here.

sun’s picture

Assigned: heyrocker » sun
Category: feature » task
Priority: Normal » Critical
Status: Postponed » Needs review
Issue tags: +API change
FileSize
12.12 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config.dispatcher.12.patch. Unable to apply patch. See the log in the details link for more information. View

This issue as well as #1702080: Introduce canonical FileStorage + (regular) cache are blocking #1447686: Allow importing and synchronizing configuration when files are updated now, and since that issue is critical, I'm bumping the priority of this and the second follow-up issue to critical as well.

Re-rolled against HEAD. Fixed stale instances of StorageDispatcher throughout core. Removed irrelevant $name changes.

Status: Needs review » Needs work

The last submitted patch, config.dispatcher.12.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
11.97 KB
PASSED: [[SimpleTest]]: [MySQL] 37,213 pass(es). View
sun’s picture

Priority: Critical » Normal

We resolved the interdependency by leaving out the (entire) UI for #1447686: Allow importing and synchronizing configuration when files are updated, so demoting back to normal.

heyrocker’s picture

Status: Needs review » Reviewed & tested by the community

Straightforward patch, and it unblocks #1702080: Introduce canonical FileStorage + (regular) cache as well as some other patches that will require rerolls now. Ship it.

no_commit_credit’s picture

FileSize
11.92 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config-1671080-17.patch. Unable to apply patch. See the log in the details link for more information. View

Fixing whitespace and a docs line over 80 chars; no other changes.

no_commit_credit’s picture

FileSize
728 bytes

Status: Reviewed & tested by the community » Needs work

The last submitted patch, config-1671080-17.patch, failed testing.

xjm’s picture

No longer applies following http://drupalcode.org/project/drupal.git/commit/1f31a38 and there is the following merge conflict in core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php:

<<<<<<< HEAD
  public function addObjectResource($object) {
=======
  public function __construct() {
    parent::__construct();
Gábor Hojtsy’s picture

Status: Needs work » Needs review
FileSize
11.71 KB
FAILED: [[SimpleTest]]: [MySQL] Drupal installation failed. View

Quickly rerolled. The init code from core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php moved to boostrap.inc's drupal_container() recently, that is why the patch did not apply anymore. I believe this should be back to RTBC as soon as it passes.

Status: Needs review » Needs work
Issue tags: -API change, -Configuration system

The last submitted patch, config-1671080-21.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review

#21: config-1671080-21.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +API change, +Configuration system

The last submitted patch, config-1671080-21.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review
FileSize
11.72 KB
PASSED: [[SimpleTest]]: [MySQL] 39,904 pass(es). View

It helps if I don't use $this in the bootstrap.inc code. Copy-paste error. Should have been $container. :)

Status: Needs review » Needs work
Issue tags: -API change, -Configuration system

The last submitted patch, config-1671080-24.patch, failed testing.

Gábor Hojtsy’s picture

Status: Needs work » Needs review

#25: config-1671080-24.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +API change, +Configuration system

The last submitted patch, config-1671080-24.patch, failed testing.

Gábor Hojtsy’s picture

We are getting random test failures. The first run had 3 failures in searching comments, the second run had term autocomplete issues. Now going for a third run.

Gábor Hojtsy’s picture

Status: Needs work » Needs review

#25: config-1671080-24.patch queued for re-testing.

sun’s picture

Status: Needs review » Needs work

This patch needs to be updated for recent config system changes. On it.

sun’s picture

Status: Needs work » Needs review
FileSize
7.61 KB
14.38 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config.dispatcher.32.patch. Unable to apply patch. See the log in the details link for more information. View

Merged HEAD, and incorporated latest improvements from #1626584: Combine configuration system changes to verify they are compatible

Interdiff is against #14.

sun’s picture

Issue tags: -API change +API clean-up
sun’s picture

FileSize
14.38 KB
PASSED: [[SimpleTest]]: [MySQL] 39,896 pass(es). View

Testbot #813 somehow is completely tripped up and stuck on #32. Trying again.

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the reroll, should be back to RTBC then :)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. I love the sound of deleting code. Thanks all.

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