8000 Cache component problem · Issue #19912 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Cache component problem #19912

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

Closed
vudaltsov opened this issue Sep 11, 2016 · 9 comments
Closed

Cache component problem #19912

vudaltsov opened this issue Sep 11, 2016 · 9 comments

Comments

@vudaltsov
Copy link
Contributor

Symfony 3.1

  1. Run from console cache:clear
  2. Run command, which saves an item in the symfony cache
  3. Open the page in browser, where this item is fetched, get $cacheItem->isHit = false

Working scenario:

  1. Run cache:clear
  2. Open some other page in browser (which doesn't request the item from the cache)
  3. Run command, which warms-up the cache item
  4. Open the page in browser, where this cache item is fetched, get $cacheItem->isHit = true and everything works fine

So, it looks like running the cache warm-up command right after the cache:clear command doesn't make sense. Is this the expected behaviour?

@jakzal
Copy link
Contributor
jakzal commented Sep 12, 2016

Do you run your command in the same environment (prod/dev) as you use in the browser?

@vudaltsov
Copy link
Contributor Author

@jakzal , in the same dev environment. I doublechecked that.
And my working scenario proves that.

@jakzal
Copy link
Contributor
jakzal commented Sep 13, 2016

@vudaltsov would you mind forking Symfony Standard edition and reproducing your problem on a new branch please? We need to isolate this problem with simplest possible code.

@vudaltsov
Copy link
Contributor Author

I reproduced the problem in the clean fork of the project, but everything worked.
I will look attentively at the business logic in my project.

Sorry for this incorrect issue.

@vudaltsov
Copy link
Contributor Author
vudaltsov commented Sep 14, 2016

@jakzal, I am digging into the problem in my actual project.

I noticed that when I run warmup command right after the cache clear command, it creates cache in a different place than if I run my command after I once visit any project page in the browser.

What finally solved the issue was commenting the 'name' element in Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\CachePoolPass at 33, because right after clearing the cache the '%kernel.name%' = '_ap' in that compiler pass. And when I go to browser, compiler passes run again, but the value is app this time.

@vudaltsov vudaltsov reopened this Sep 14, 2016
@vudaltsov
Copy link
Contributor Author

@nicolas-grekas, could you, please, help with this?

@Simperfit
Copy link
Contributor

What are you using as your system environment (docker / no container / vagrant) ?

@vudaltsov
Copy link
Contributor Author

@Simperfit, no container. Just directly on Ubuntu I am working on.

@nicolas-grekas
Copy link
Member

Should be fixed by #20147

fabpot added a commit that referenced this issue Oct 5, 2016
…name in cache:clear command (nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Alter container class instead of kernel name in cache:clear command

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #19912
| License       | MIT
| Doc PR        | -

The decision to alter kernel's name instead of the container's class dates from cc3a40e
But this is causing issues such as #19912. Looking more carefully, the real intent is to change the container class and there is no need to alter also the kernel's name at this stage.

Commits
-------

73c9693 [FrameworkBundle] Alter container class instead of kernel name in cache:clear command
@fabpot fabpot closed this as completed Oct 5, 2016
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

7 participants
0