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

[Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapter#36291

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:4.4fromJontsa:ticket_35350
Oct 3, 2020

Conversation

@Jontsa
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#35350
LicenseMIT
Doc PR

UpdatesSymfony\Component\Lock\Store\StoreFactory to accept same DSN syntax asSymfony\Component\Cache\Adapter\AbstractAdapter which is used to create Redis class instance.

@JontsaJontsa changed the titleTicket 35350[Lock] Fix StoreFactory to accept same DSN syntax as AbstractAdapterMar 31, 2020
Copy link
Member

@jderussejderusse left a comment

Choose a reason for hiding this comment

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

I'm fine with this PR form a technical point of view.

But you have to keep in mind that using Lock with a cluster of Redis/memcached is not reliable: by defaultreplication is asynchronous, meaning, one process is able to acquire a Lock, which may not be propagated to replica, and, if primary has a failure, another process will be able to acquire the same lock .

You should use a CombineStore to achieve a HA with multiple Memcached/Redis

nb: This is already recommended in Documentation:https://symfony.com/doc/current/components/lock.html#id6

I think we should open a PR to add aWAIT in RedisStore that assure that a least 50%+1 servers in the cluster are synchronized

@nicolas-grekasnicolas-grekas added this to the4.4 milestoneApr 3, 2020
@NyholmNyholm mentioned this pull requestMay 28, 2020
3 tasks
@jderusse
Copy link
Member

fixed by#37590

@fabpot
Copy link
Member

@jderusse Shall we close then? Should we also close#35350?

@Jontsa
Copy link
ContributorAuthor

#37590 partially fixes this issue. StoreFactory still does not support the same exact DSN syntax as Symfony\Component\Cache\Adapter\AbstractAdapter for Redis connections.

But this PR can be closed if we do not want to allow DSN with multiple Redis hosts for Locks.

@jderusse
Copy link
Member

jderusse commentedAug 6, 2020
edited
Loading

You're right@Jontsa.

Can you, please, rebase your PR and keep the part about DSN pattern?

@fabpotfabpot added the Lock labelAug 11, 2020
@fabpot
Copy link
Member

@Jontsa Do you time to finish this PR?

@fabpot
Copy link
Member

@Jontsa I think you will need to rebase on the current 4.4 branch as there are some conflicts.

Copy link
Member

@jderussejderusse left a comment
edited
Loading

Choose a reason for hiding this comment

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

A small comment about change in tests.

Then, I'm 👍 with the PR

yield ['memcached:?host[localhost]&host[localhost:12345]', MemcachedStore::class];
}
if (class_exists(\Redis::class) &&class_exists(AbstractAdapter::class)) {
if ((class_exists(\Redis::class) ||class_exists(\Predis\Client::class)) &&class_exists(AbstractAdapter::class)) {
Copy link
Member

Choose a reason for hiding this comment

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

Revert this.

The purpose of this check is to avoid failing tests when the extension is not installed.

By checking if Predis is installed (which is always true because in require-dev) this breaks the initial check.

Copy link
Member

Choose a reason for hiding this comment

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

fixed in6a79f3e

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

Taking over

@fabpot
Copy link
Member

Thank you@Jontsa.

@fabpotfabpot merged commit35e04d9 intosymfony:4.4Oct 3, 2020
This was referencedOct 4, 2020
@JontsaJontsa deleted the ticket_35350 branchDecember 18, 2024 10:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@jderussejderussejderusse left review comments

@fabpotfabpotfabpot approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

7 participants

@Jontsa@jderusse@fabpot@stof@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp