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

Don't throw error while clearing Redis cache #6744

Closed
sohaibameenpk007 opened this issue Jul 12, 2023 · 0 comments · Fixed by #6821
Closed

Don't throw error while clearing Redis cache #6744

sohaibameenpk007 opened this issue Jul 12, 2023 · 0 comments · Fixed by #6821
Assignees
Milestone

Comments

@sohaibameenpk007
Copy link

sohaibameenpk007 commented Jul 12, 2023

ERROR: ABP Redis Cache : 2023-07-10 13:55:17,673 - ERR Script attempted to access a non local key in a cluster node script: fea3235e8ce23bcab0e0ad87c68f38d7b03cda64, on @user_script:4. - StackExchange.Redis.RedisServerException: ERR Script attempted to access a non local key in a cluster node script: fea3235e8ce23bcab0e0ad87c68f38d7b03cda64, on @user_script:4.

System tries to clear cache based on the key being provided by calling ClearAsync() but if the key is not found on cluster node then it generates this exception.

ABP Version : 5.10.1.0

await _cacheManager.GetCache(keyCache).ClearAsync();

return await _cacheManager.GetCache(keyCache).GetAsync(subKeyCache, func);

return await _cacheManager.GetCache(keyCache).GetOrDefaultAsync(subKeyCache);

How can I validate if the key exists or not on cluster node.

I need to handle it gracefully since I am also using GetAsync(subKeyCache, func), GetOrDefaultAsync(subKeyCache)

Best,
Sohaib

@ismcagdas ismcagdas added this to the v9.0 milestone Oct 9, 2023
@ismcagdas ismcagdas self-assigned this Oct 12, 2023
@ismcagdas ismcagdas changed the title ABP Redis Cache : 2023-07-10 13:55:17,673 - ERR Script attempted to access a non local key in a cluster node script: fea3235e8ce23bcab0e0ad87c68f38d7b03cda64, on @user_script:4. - StackExchange.Redis.RedisServerException: ERR Script attempted to access a non local key in a cluster node script: fea3235e8ce23bcab0e0ad87c68f38d7b03cda64, on @user_script:4. Don't throw error while clearing Redis cache Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants