Skip to content

Cache: RedisAdapter connects during cache:warmup (at least for Doctrine) #24865

Closed
@weaverryan

Description

@weaverryan
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.2?

Steps to repeat:

  1. git clone git@github.com:weaverryan/flex-redis-bug.git

  2. composer install

It will explode with:

screen shot 2017-11-07 at 3 15 49 pm

The project is a standard Flex app, but with the following changes:

A) Doctrine ORM is installed

B) The app cache uses redis (see framework.yaml)

C) We're in the prod environment

The error happens on cache:clear. This comes from the result cache configured by default in prod for Doctrine: https://github.com/symfony/recipes/blob/93d80647f510e00a52db869251136593a2dc2182/doctrine/doctrine-bundle/1.6/config/packages/prod/doctrine.yaml#L28

This is caused by a lack of laziness... somewhere. It could be in Doctrine - this whole thing starts when we try to warmup the proxies... which instantiates the entity managers (which instantiates result caches and also connection objects). Or, it could be in the Cache component, where (at least with Redis) a connection to the Redis server is established in order to create the RedisAdapter object (even if you never make any connections to it).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions