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

mpetrov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new fc64fccbae1 IGNITE-27959 Fixed flaky 
PerformanceStatisticsThinClientTest#testCacheOperation (#12803)
fc64fccbae1 is described below

commit fc64fccbae153a3f7aed1f2dd531196219eb10a3
Author: Mikhail Petrov <[email protected]>
AuthorDate: Wed Feb 25 09:59:25 2026 +0300

    IGNITE-27959 Fixed flaky 
PerformanceStatisticsThinClientTest#testCacheOperation (#12803)
---
 .../PerformanceStatisticsProcessor.java                   | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
index 4fcdbc9b560..5d689d754b5 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
@@ -77,6 +77,9 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
     /** Rotate performance statistics process. */
     private DistributedProcess<Serializable, Serializable> rotateProc;
 
+    /** Whether performance statistics collection is running. */
+    private volatile boolean isRunning;
+
     /** @param ctx Kernal context. */
     public PerformanceStatisticsProcessor(GridKernalContext ctx) {
         super(ctx);
@@ -336,7 +339,7 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
 
     /** @return {@code True} if collecting performance statistics is enabled. 
*/
     public boolean enabled() {
-        return writer != null;
+        return isRunning;
     }
 
     /** {@inheritDoc} */
@@ -365,7 +368,7 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
     private void startWriter() {
         try {
             synchronized (mux) {
-                if (writer != null)
+                if (isRunning)
                     return;
 
                 writer = new FilePerformanceStatisticsWriter(ctx);
@@ -373,6 +376,8 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
 
                 writer.start();
                 U.newThread(sysViewWriter).start();
+
+                isRunning = true;
             }
 
             lsnrs.forEach(PerformanceStatisticsStateListener::onStarted);
@@ -387,7 +392,7 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
     /** Stops performance statistics writer. */
     private void stopWriter() {
         synchronized (mux) {
-            if (writer == null)
+            if (!isRunning)
                 return;
 
             FilePerformanceStatisticsWriter writer = this.writer;
@@ -398,6 +403,8 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
 
             writer.stop();
             U.awaitForWorkersStop(Collections.singleton(sysViewWriter), true, 
log);
+
+            isRunning = false;
         }
 
         log.info("Performance statistics writer stopped.");
@@ -408,7 +415,7 @@ public class PerformanceStatisticsProcessor extends 
GridProcessorAdapter {
         FilePerformanceStatisticsWriter oldWriter = null;
 
         synchronized (mux) {
-            if (writer == null)
+            if (!isRunning)
                 return;
 
             FilePerformanceStatisticsWriter newWriter = new 
FilePerformanceStatisticsWriter(ctx);

Reply via email to