JackieTien97 commented on code in PR #16900:
URL: https://github.com/apache/iotdb/pull/16900#discussion_r2612535364


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/session/IClientSession.java:
##########
@@ -37,27 +38,27 @@
 
 public abstract class IClientSession {
 
-  private long id;
+  private volatile long id;
 
   private ClientVersion clientVersion;
 
   private ZoneId zoneId;
 
   private TimeZone timeZone;
 
-  private long userId;
+  private volatile long userId;
 
-  private String username;
+  private volatile String username;
 
-  private boolean login = false;
+  private volatile boolean login = false;
 
   private long logInTime;
 
   private SqlDialect sqlDialect = SqlDialect.TREE;
 
   @Nullable private String databaseName;
 
-  private long lastActiveTime;
+  private volatile long lastActiveTime = CommonDateTimeUtils.currentTime();

Review Comment:
   No need to add these volatile? As discussed last night, ConcurrentHashMap 
has already made sure that getAllConnections can see the changes made by other 
threads.



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

Reply via email to