srowen commented on code in PR #44907:
URL: https://github.com/apache/spark/pull/44907#discussion_r1471343646


##########
streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala:
##########
@@ -238,14 +237,14 @@ class FileBasedWriteAheadLogSuite
     val executionContext = ExecutionContext.fromExecutorService(fpool)
 
     class GetMaxCounter {
-      private val value = new AtomicInteger()
+      private var value = 0
       @volatile private var max: Int = 0
       def increment(): Unit = synchronized {
-        val atInstant = value.incrementAndGet()
+        val atInstant = value + 1
         if (atInstant > max) max = atInstant
       }
-      def decrement(): Unit = synchronized { value.decrementAndGet() }
-      def get(): Int = synchronized { value.get() }
+      def decrement(): Unit = synchronized { value = value - 1 }
+      def get(): Int = synchronized { value }
       def getMax(): Int = synchronized { max }

Review Comment:
   I can't see why this change would be different. But there is probably some 
subtle issue with memory barriers or whatever. I don't think it's worth 
changing.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to