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

Redis transaction is not closed when PSR-6 cache is used in combination with Redis store #47192

Closed

Conversation

martinssipenko
Copy link
Contributor

I've created a test case addressing a case where the PSR-6 adapter in combination with the Redis store leads to the Redis transaction not being closed.

The problem is that if exception is thrown as part of $cache->save($item); then Symfony\Component\Cache\Adapter\Psr16Adapter eats the exception leading to the transaction not being closed in Illuminate\Cache\RedisStore:putMany() ($this->connection()->exec(); is never called). This later leads to read failures as Redis is returning an object that can't be unserialized.

I don't know what would be the best way to fix this, thus I'm seeking guidance here.

@martinssipenko martinssipenko marked this pull request as ready for review May 24, 2023 08:01
@rolandsusans
Copy link
Contributor

rolandsusans commented May 24, 2023

@martinssipenko I created this PR as a "potentially better" RedisStore implementation for method putMany https://github.com/martinssipenko/framework/pull/1/files same as
https://github.com/laravel/framework/pull/47193/files

The idea is to open Redis transactions when we are sure that all values are serialized.

@taylorotwell
Copy link
Member

Closing since PR is open.

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.

3 participants