This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 3231caa [Functions] ConcurrentHashMap should be used for caching
producers (#11820)
3231caa is described below
commit 3231caa894a24fa9048adf4628316d280d02c679
Author: Lari Hotari <[email protected]>
AuthorDate: Mon Aug 30 22:32:57 2021 +0300
[Functions] ConcurrentHashMap should be used for caching producers (#11820)
---
.../src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
index a57d53b..35fffc6 100644
---
a/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
+++
b/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/instance/ContextImpl.java
@@ -167,7 +167,7 @@ class ContextImpl implements Context, SinkContext,
SourceContext, AutoCloseable
if (useThreadLocalProducers) {
tlPublishProducers = new ThreadLocal<>();
} else {
- publishProducers = new HashMap<>();
+ publishProducers = new ConcurrentHashMap<>();
}
if (config.getFunctionDetails().getUserConfig().isEmpty()) {