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

persistent connections - use a different persistent_id per DSN #141

Merged
merged 1 commit into from Jun 18, 2014

Conversation

nail
Copy link
Contributor

@nail nail commented Jun 15, 2014

When using persistent connections with different clients using the same redis server but different databases, the call to 'select' will only be issued during the client's construction, and it will happen on the same persistent connection. You'll end up working on the last opened client's database.

To fix this, I propose to use the persistent_id that can be given to pconnect (https://github.com/nicolasff/phpredis#pconnect-popen) and to tie the persistent connection to the full dsn (using an sha1 of the DSN).

snc added a commit that referenced this pull request Jun 18, 2014
persistent connections - use a different persistent_id per DSN
@snc snc merged commit 75ce277 into snc:master Jun 18, 2014
@snc
Copy link
Owner

snc commented Jun 18, 2014

Thanks for this nice addition!

@pedro-veiga
Copy link

Hello, I'd like to ask why was this addition for PhpRedis removed shortly after in commit Update for PRedis 1.0 .
Was it removed by mistake perhaps? Or is there a better way to provide a persistent_id for PhpRedis clients?
Thank you.

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

Successfully merging this pull request may close these issues.

None yet

3 participants