eolivelli commented on a change in pull request #14346:
URL: https://github.com/apache/pulsar/pull/14346#discussion_r810526246
##########
File path:
pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/functioncache/FunctionCacheManagerImpl.java
##########
@@ -74,9 +76,9 @@ public void registerFunctionInstance(String fid,
}
synchronized (cacheFunctions) {
- FunctionCacheEntry entry = cacheFunctions.get(fid);
-
- if (null == entry) {
+ final AtomicBoolean computed = new AtomicBoolean(false);
+ final AtomicReference<Throwable> throwable = new
AtomicReference<>();
+ FunctionCacheEntry entry = cacheFunctions.computeIfAbsent(fid, __
-> {
Review comment:
Please note that the contract of computeIfAbsent is that the function
must be side effect free because it can be executed multiple times.
I am not sure that this function is side effect free
Can you please double check?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]