aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/channel/client_setup.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-18 17:17:51 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-02-18 17:20:17 -0800
commit43a2b176f1825151a379cb171896f134580ae4c4 (patch)
tree72c878cdb6f2530bfb55411cd1ef66c1cdc399a8 /src/core/channel/client_setup.h
parentfb89ee38d5d464a48b9866d7c7941976a031e8fb (diff)
Fix a TSAN reported race
I think this was the frequent crash in uds_cancel_after_invoke. The race happens because a channel is deleted concurrently with an address being resolved (and UDS gets the resolution fast enough for this to actually happen). The fix is to guarantee no callbacks will be made after cancel has been called (which was the original guaranteee that got lost somewhere).
Diffstat (limited to 'src/core/channel/client_setup.h')
-rw-r--r--src/core/channel/client_setup.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/channel/client_setup.h b/src/core/channel/client_setup.h
index 6ac3fe62f1..f2b64265bc 100644
--- a/src/core/channel/client_setup.h
+++ b/src/core/channel/client_setup.h
@@ -58,6 +58,12 @@ void grpc_client_setup_request_finish(grpc_client_setup_request *r,
const grpc_channel_args *grpc_client_setup_get_channel_args(
grpc_client_setup_request *r);
+/* Call before calling back into the setup listener, and call only if
+ this function returns 1. If it returns 1, also promise to call
+ grpc_client_setup_cb_end */
+int grpc_client_setup_cb_begin(grpc_client_setup_request *r);
+void grpc_client_setup_cb_end(grpc_client_setup_request *r);
+
/* Get the deadline for a request passed in to initiate. Implementations should
make a best effort to honor this deadline. */
gpr_timespec grpc_client_setup_request_deadline(grpc_client_setup_request *r);