Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jrockowitz opened this issue Jan 25, 2019 · 4 comments

Comments

@jrockowitz
Copy link

Hi,

@benjifisher Recently created Issue #3022909: Update functions request non-existent services in the Webform issue queue which lead me to look at Drupal core's Issue #2918906: Changes to service definitions can cause fatal errors until services cache is cleared

I think @daniel.nitsche's comment #7 has some merit so I decided to take my first crack at using GitHub. (Yep, I only familiar with Drupal.org and BitBucket).

The solution/concept is to use the composer.lock file's hash as Drupal's deployment identifier in settings.php. This approach guarantees that when any Drupal core or contrib code is updated via composer, Drupal's service definitions are updated.

I forked the main repos and created this branch with a single commit.

Is this a good idea?

Is calling file_get_contents() too much of a performance hit?

Does this successfully prevent fatal errors when service definitions are changed?


A slight different approach which I just thought of would be to use the composer.lock files modified timestamp. This solution requires no changes to 'drupal-composer' and would just need to be documented.

$settings['deployment_identifier'] = filemtime('../composer.lock');

@jrockowitz
Copy link
Author

I just read Cost of file modification time checks and using filemtime() is clearly much faster than using file_get_contents(). Still, we are only talking about a few milliseconds.

@weitzman
Copy link
Contributor

I'd be fine with that change. Lets see what others thing. Ping @webflo

@rodrigoaguilera
Copy link
Contributor

I also think the composer.lock last modification time should be part of the deployment identifier

@AlexSkrypnyk
Copy link
Collaborator

This pull request/issue has been inactive for over a year and is being closed due to inactivity. If the issue still persists or the contribution is still relevant, please feel free to reopen it or create a new one.

Thank you for your understanding and your contributions to the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants