Skip to content

Commit

Permalink
[revert][misc] "modify check waitingForPingResponse with volatile (#1…
Browse files Browse the repository at this point in the history
…2615)" (#19439)

This reverts commit 62e2547.

### 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 fb28d83)
  • Loading branch information
michaeljmarshall committed Feb 8, 2023
1 parent 4a1ac0a commit f6da22b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f6da22b

Please sign in to comment.