chenBright commented on code in PR #3330:
URL: https://github.com/apache/brpc/pull/3330#discussion_r3449586740
##########
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:
What is `_fd_version` used for?
##########
src/brpc/controller.h:
##########
@@ -762,6 +776,10 @@ friend void
policy::ProcessThriftRequest(InputMessageBase*);
// CONNECTION_TYPE_SINGLE. Otherwise, it may be a temporary
// socket fetched from socket pool
SocketUniquePtr sending_sock;
+ // In-class default so every Call init path (default ctor, Reset(), and
+ // the Call(Call*) copy ctor used for backup/retry) is NONE unless set
+ // explicitly. A backup/retry never inherits transaction affinity.
+ BindSockAction bind_sock_action = BIND_SOCK_NONE;
Review Comment:
`bind_sock_action` needs to be set in `ResetPods()`.
--
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]