(brpc) branch master updated: socket: fix potential double close (#2663)

2024-06-24 Thread guangmingchen
This is an automated email from the ASF dual-hosted git repository.

guangmingchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
 new f12bc52a socket: fix potential double close (#2663)
f12bc52a is described below

commit f12bc52a55770ac2bcd5ed658d406581dd6f579b
Author: Jay 
AuthorDate: Mon Jun 24 16:55:13 2024 +0800

socket: fix potential double close (#2663)

`_fd` should be reset if `ResetFileDescriptor` is going to return -1,
otherwise the fd will be closed in callers like `CheckConnectedAndKeepWrite`
or `Server::StartInernal` and socket lifecycle methods like `BeforeRecycled`
or `WaitAndReset`.
---
 src/brpc/socket.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/brpc/socket.cpp b/src/brpc/socket.cpp
index ac1c37ae..12230d7f 100644
--- a/src/brpc/socket.cpp
+++ b/src/brpc/socket.cpp
@@ -594,6 +594,7 @@ int Socket::ResetFileDescriptor(int fd) {
 // Make the fd non-blocking.
 if (butil::make_non_blocking(fd) != 0) {
 PLOG(ERROR) << "Fail to set fd=" << fd << " to non-blocking";
+_fd.store(-1, butil::memory_order_release);
 return -1;
 }
 // turn off nagling.


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [PR] socket: fix potential double close (brpc)

2024-06-24 Thread via GitHub


chenBright merged PR #2663:
URL: https://github.com/apache/brpc/pull/2663


-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org



Re: [I] Is there already any plan about switch bazel workspace to bzlmod? (brpc)

2024-06-24 Thread via GitHub


chenBright commented on issue #2654:
URL: https://github.com/apache/brpc/issues/2654#issuecomment-2185814847

   Sorry, I'm not familiar with bazel.
   
   @wwbmmm Is there anyone familiar with bazel who can review it?


-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org