-
Notifications
You must be signed in to change notification settings - Fork 735
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
Question on stdlib cache? #19187
Comments
Another issue is that we are locking all the |
IINM, cache misses can happen due to this. But since this is a simple cache. I believe that is acceptable.
|
With the current implementation, we can't omit the global cache map. |
I assume original post is regarding data corruption that can occur due to race condition. But the given example there (i.e. hasKey) doesn't cause any such race conditions it seems. Ballerina But I think following line in
So this can cause cache to evict wrong keys in case the values in |
Description:
So I was looking at the cache implementation at :
https://github.com/ballerina-platform/ballerina-lang/blob/release-1.0.1/stdlib/cache/src/main/ballerina/src/cache/cache.bal
I have following questions:
put()
function but not inget
function. is this intentional?!self.hasKey(key)
becomestrue
and aput()
happens before thereturn ();
get()
andput()
But I could be wrong given that I don't have a clear understanding of how ballerina's concurrency is handled.
Steps to reproduce:
N/A
Affected Versions:
v1.0, v 1.0.1
OS, DB, other environment details and versions:
MacOS, Jdk 1.8
Suggested Assignees (optional):
@wggihan @pubudu91 @a5anka
The text was updated successfully, but these errors were encountered: