rajvarun77 commented on code in PR #3330:
URL: https://github.com/apache/brpc/pull/3330#discussion_r3463962904


##########
src/brpc/socket.h:
##########
@@ -840,6 +843,9 @@ friend class TransportFactory;
     butil::atomic<int> _fd;  // -1 when not connected.
     int _tos;                // Type of service which is actually only 8bits.
     int64_t _reset_fd_real_us; // When _fd was reset, in microseconds.
+    // ABA/version counter; written on fd reset and read via fd_version() from
+    // other threads, so use relaxed atomics to avoid a data race.
+    butil::atomic<uint64_t> _fd_version;  // _fd_version, used only for mysql 
now.

Review Comment:
   Used to track when the underlying physical connection changes. For the new 
MySQL protocol implementation, we need to detect socket reconnections so we 
know exactly when to safely reinitialize the MySQL prepared statements.



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