You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2023/02/08 22:07:27 UTC

[pulsar] branch branch-2.10 updated: [revert][misc] "modify check waitingForPingResponse with volatile (#12615)" (#19439)

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

mmarshall pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new f6da22b29d4 [revert][misc] "modify check waitingForPingResponse with volatile (#12615)" (#19439)
f6da22b29d4 is described below

commit f6da22b29d41b773825944a6eb250f5fa078c35a
Author: Michael Marshall <mm...@apache.org>
AuthorDate: Wed Feb 8 16:00:09 2023 -0600

    [revert][misc] "modify check waitingForPingResponse with volatile (#12615)" (#19439)
    
    This reverts commit 62e2547bea445c4f67935a57f59886757facbd2d.
    
    ### Motivation
    
    The motivation for #12615 relies on an incorrect understanding of Netty's threading model. The `ctx.executor()` is the context's event loop thread that is the same thread used to process messages. The `waitingForPingResponse` variable is only ever updated/read from the context's event loop, so there is no need to make the variable `volatile`.
    
    ### Modifications
    
    * Remove `volatile` keyword for `waitingForPingResponse`
    
    ### Verifying this change
    
    Read through all references to the variable.
    
    ### Documentation
    
    - [x] `doc-not-needed`
    
    ### Matching PR in forked repository
    
    PR in forked repository: Skipping for this trivial PR.
    
    (cherry picked from commit fb28d836ae1155fb3aaf2fe5eb0113f7f6a19ca0)
---
 .../src/main/java/org/apache/pulsar/common/protocol/PulsarHandler.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarHandler.java b/pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarHandler.java
index 03fa4c17b08..3cd91809f52 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarHandler.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarHandler.java
@@ -37,7 +37,7 @@ public abstract class PulsarHandler extends PulsarDecoder {
     protected SocketAddress remoteAddress;
     private int remoteEndpointProtocolVersion = ProtocolVersion.v0.getValue();
     private final long keepAliveIntervalSeconds;
-    private volatile boolean waitingForPingResponse = false;
+    private boolean waitingForPingResponse = false;
     private ScheduledFuture<?> keepAliveTask;
 
     public int getRemoteEndpointProtocolVersion() {