Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache][Lock] Add RedisProxy for lazy Redis connections#24887

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromnicolas-grekas:lazy-redis
Nov 10, 2017

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedNov 9, 2017
edited
Loading

QA
Branch?3.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#24865
LicenseMIT
Doc PR-

That's the only provider that is not lazy by default, leading to bad DX (see linked issue.)
Best reviewedignoring whitespaces.

@nicolas-grekas
Copy link
MemberAuthor

(now investigating the failure)

@nicolas-grekas
Copy link
MemberAuthor

PR ready.

@jderusse
Copy link
Member

Same issue affects the Lock component, and could be patched in the same way. I will open a PR when this one will be merged to reuse the RedisProxy. (thanks FWBundle has a dependency on Cache)

Diff is to take into account and allow the new classRedisProxy inSymfony\Component\Lock\Store\RedisStore and inSymfony\Component\Lock\Store\StoreFactory and add thearray('lazy' => true) in theFrameworkExtension

@nicolas-grekasnicolas-grekas changed the title[Cache] Add RedisProxy for lazy Redis connections[Cache][Lock] Add RedisProxy for lazy Redis connectionsNov 10, 2017
$this->enableVersioning();
}elseif (!$redisClientinstanceof \Redis && !$redisClientinstanceof \RedisArray && !$redisClientinstanceof \Predis\Client) {
}elseif (!$redisClientinstanceof \Redis && !$redisClientinstanceof \RedisArray && !$redisClientinstanceof \Predis\Client && !$redisClientinstanceof RedisProxy) {
thrownewInvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given',__METHOD__,is_object($redisClient) ?get_class($redisClient) :gettype($redisClient)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this message needs an update right? Same for below.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd prefer not: RedisProxy is internal (same for docblocks)

chalasr reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

right! 👍

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit1f5e353 intosymfony:3.4Nov 10, 2017
fabpot added a commit that referenced this pull requestNov 10, 2017
…s (nicolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[Cache][Lock] Add RedisProxy for lazy Redis connections| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#24865| License       | MIT| Doc PR        | -That's the only provider that is not lazy by default, leading to bad DX (see linked issue.)Best reviewed [ignoring whitespaces](https://github.com/symfony/symfony/pull/24887/files?w=1).Commits-------1f5e353 [Cache][Lock] Add RedisProxy for lazy Redis connections
@nicolas-grekasnicolas-grekas deleted the lazy-redis branchNovember 10, 2017 15:26
This was referencedNov 12, 2017
@ahilles107
Copy link

ahilles107 commentedNov 20, 2017
edited
Loading

Hey, looks like it breaks Memcached adapter.

constant(): Couldn't find constant Memcached::OPT_LAZY--in MemcachedTrait.php (line 148)at MemcachedAdapter::Symfony\Component\Cache\Traits\{closure}(2,  'constant(): Couldn\'t find constant Memcached::OPT_LAZY',  '/Users/pawelmikolajczuk/Projects/asystentciazy-server/vendor/symfony/cache/Traits/MemcachedTrait.php',  148, array('servers' => array(array('127.0.0.1', 11211, 0)), 'options' => array('LAZY' => true, 'SERIALIZER' => 'php'), 'client' => object(Memcached), 'username' => null, 'password' => null, 'dsn' => 'memcached://127.0.0.1:11211', 'i' => 0, 'params' => array('scheme' => 'file', 'host' => '127.0.0.1', 'port' => 11211, 'weight' => 0), 'value' => true, 'name' => 'LAZY'))at constant('Memcached::OPT_LAZY')in MemcachedTrait.php (line 148)at MemcachedAdapter::createConnection(array(array('127.0.0.1', 11211, 0)), array('LAZY' => true, 'SERIALIZER' => 'php'))in AbstractAdapter.php (line 134)at AbstractAdapter::createConnection('memcached://127.0.0.1:11211', array('lazy' => true))in AppDevDebugProjectContainer.php (line 2444)
doctrine:    orm:        ...        metadata_cache_driver:            type: service            id: doctrine.system_cache_provider        query_cache_driver:            type: service            id: doctrine.system_cache_provider        result_cache_driver:            type: service            id: doctrine.result_cache_providerservices:    doctrine.result_cache_provider:        class: Symfony\Component\Cache\DoctrineProvider        public: false        arguments:            - '@doctrine.result_cache_pool'    doctrine.system_cache_provider:        class: Symfony\Component\Cache\DoctrineProvider        public: false        arguments:            - '@doctrine.system_cache_pool'framework:    cache:        default_memcached_provider: "memcached://127.0.0.1:11211"        pools:            doctrine.result_cache_pool:                adapter: cache.app            doctrine.system_cache_pool:                adapter: cache.adapter.memcached                public: true

@nicolas-grekas
Copy link
MemberAuthor

@ahilles107 correct, see#25038. I invite you to create issues when encountering an issue, as comments on closed PRs/issues are kinda lost most of the time. And looking at the history before doing so ;)

ahilles107 reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@jderussejderussejderusse approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@ro0NLro0NLro0NL approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

7 participants

@nicolas-grekas@jderusse@fabpot@ahilles107@ro0NL@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp