Changes to service definitions can cause fatal errors until services cache is cleared

Created on 26 October 2017, about 7 years ago
Updated 30 August 2024, 4 months ago

Problem/Motivation

Sometimes, contrib (and custom) modules need to change their service definitions. For example, an additional argument may need to be passed, which can change the function/service definition:
https://www.drupal.org/node/2826466
http://cgit.drupalcode.org/webform/commit/webform.services.yml?id=173030...
http://cgit.drupalcode.org/acquia_contenthub/commit/?id=3d5f6890a86e1f53...

Service definition are stored in the cache_container table, however when a code change to a service definition is deployed, a site may be broken until the cache_container table is rebuilt.

Proposed resolution

I'd like to know if this has been a problem for anyone, and if it should be considered a bug, or a limitation. While it's easy enough to clear the cache_container cache during a deploy, this becomes more of a problem when you have a number of multisites.

Ideally, there would be no downtime during a deploy under this circumstance, but minimising the downtime would also be desirable, as would not relying on deploy processes to handle this.

Remaining tasks

-
-
- Decide who is responsible for clearing the services cache? (contrib, core, or deployment scripts)

Related issues

Here is where the cache was originally moved to the DB if it's relevant: https://www.drupal.org/node/2497243
This is trying the solve the issue of new services (rather than alterations to existing services): https://www.drupal.org/node/2863986

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Cache 

Last updated about 2 hours ago

Created by

🇦🇺Australia daniel.nitsche Melbourne, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024