This is an automated email from the ASF dual-hosted git repository.

tkalkirill pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new adb88ffb65 IGNITE-21696 Don't synchronize on AtomicReferenceArray 
(#3429)
adb88ffb65 is described below

commit adb88ffb659c595f975d7b08eff4f9f20c63c027
Author: Roman Puchkovskiy <roman.puchkovs...@gmail.com>
AuthorDate: Mon Mar 18 10:31:07 2024 +0400

    IGNITE-21696 Don't synchronize on AtomicReferenceArray (#3429)
---
 check-rules/spotbugs-excludes.xml                            | 12 ------------
 .../apache/ignite/internal/network/LazyStripedExecutors.java |  4 +++-
 .../ignite/internal/network/netty/ConnectionManager.java     |  2 +-
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/check-rules/spotbugs-excludes.xml 
b/check-rules/spotbugs-excludes.xml
index e111eb9e89..eb117abc40 100644
--- a/check-rules/spotbugs-excludes.xml
+++ b/check-rules/spotbugs-excludes.xml
@@ -244,18 +244,6 @@
     <Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
     <Class name="org.apache.ignite.internal.pagememory.util.PageHandler"/>
   </Match>
-  <Match>
-    <!-- TODO: https://issues.apache.org/jira/browse/IGNITE-21696 -->
-    <Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER"/>
-    <Class name="org.apache.ignite.internal.network.LazyStripedExecutors"/>
-    <Method name="stripedExecutorFor"/>
-  </Match>
-  <Match>
-    <!-- TODO: https://issues.apache.org/jira/browse/IGNITE-21697 -->
-    <Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
-    <Class name="org.apache.ignite.internal.network.netty.ConnectionManager"/>
-    <Method name="handleNodeLeft"/>
-  </Match>
   <Match>
     <!-- TODO: https://issues.apache.org/jira/browse/IGNITE-21698 -->
     <Bug pattern="BX_UNBOXING_IMMEDIATELY_REBOXED"/>
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/LazyStripedExecutors.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/LazyStripedExecutors.java
index 5d90c5070b..dcc5a35c09 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/LazyStripedExecutors.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/LazyStripedExecutors.java
@@ -42,6 +42,8 @@ abstract class LazyStripedExecutors implements 
ManuallyCloseable {
     private final AtomicBoolean closed = new AtomicBoolean();
     private final AtomicReferenceArray<StripedExecutor> array = new 
AtomicReferenceArray<>(Short.MAX_VALUE + 1);
 
+    private final Object executorCreationMutex = new Object();
+
     /**
      * Executes a command on a stripe with the given index. If the executor is 
stopped, returns a special executor that executes nothing.
      *
@@ -68,7 +70,7 @@ abstract class LazyStripedExecutors implements 
ManuallyCloseable {
             return existing;
         }
 
-        synchronized (array) {
+        synchronized (executorCreationMutex) {
             existing = array.get(executorIndex);
             if (existing != null) {
                 return existing;
diff --git 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
index 36bf399a3f..a5cbdf61ce 100644
--- 
a/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
+++ 
b/modules/network/src/main/java/org/apache/ignite/internal/network/netty/ConnectionManager.java
@@ -600,7 +600,7 @@ public class ConnectionManager implements 
ChannelCreationListener {
 
         // TODO: IGNITE-21207 - remove descriptors for good.
 
-        connectionMaintenanceExecutor.submit(
+        connectionMaintenanceExecutor.execute(
                 () -> closeChannelsWith(id).whenCompleteAsync((res, ex) -> {
                     // Closing descriptors separately (as some of them might 
not have an operating channel attached, but they
                     // still might have unacknowledged messages/futures).

Reply via email to