grpc 1.17.1 → 1.18.0.pre1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of grpc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Makefile +1228 -988
- data/etc/roots.pem +242 -30
- data/include/grpc/grpc.h +2 -1
- data/include/grpc/grpc_security_constants.h +3 -3
- data/include/grpc/impl/codegen/atm_gcc_sync.h +2 -0
- data/include/grpc/impl/codegen/atm_windows.h +2 -0
- data/include/grpc/impl/codegen/compression_types.h +2 -1
- data/include/grpc/impl/codegen/grpc_types.h +1 -1
- data/include/grpc/impl/codegen/port_platform.h +9 -0
- data/src/core/ext/filters/client_channel/client_channel.cc +163 -882
- data/src/core/ext/filters/client_channel/health/health_check_client.cc +2 -4
- data/src/core/ext/filters/client_channel/health/health_check_client.h +2 -3
- data/src/core/ext/filters/client_channel/lb_policy.cc +1 -1
- data/src/core/ext/filters/client_channel/lb_policy.h +8 -17
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc +176 -216
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc +20 -23
- data/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc +49 -52
- data/src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc +13 -35
- data/src/core/ext/filters/client_channel/lb_policy/subchannel_list.h +31 -30
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds.cc +69 -225
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_channel_secure.cc +20 -23
- data/src/core/ext/filters/client_channel/lb_policy/xds/xds_load_balancer_api.h +1 -1
- data/src/core/ext/filters/client_channel/lb_policy_factory.h +2 -84
- data/src/core/ext/filters/client_channel/request_routing.cc +936 -0
- data/src/core/ext/filters/client_channel/request_routing.h +177 -0
- data/src/core/ext/filters/client_channel/resolver.cc +1 -1
- data/src/core/ext/filters/client_channel/resolver.h +1 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +37 -26
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc +30 -18
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc +119 -100
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h +8 -5
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc +5 -4
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_posix.cc +2 -1
- data/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_windows.cc +12 -14
- data/src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc +5 -9
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc +2 -1
- data/src/core/ext/filters/client_channel/resolver/fake/fake_resolver.h +1 -2
- data/src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc +17 -17
- data/src/core/ext/filters/client_channel/resolver_result_parsing.cc +45 -52
- data/src/core/ext/filters/client_channel/resolver_result_parsing.h +13 -17
- data/src/core/ext/filters/client_channel/server_address.cc +103 -0
- data/src/core/ext/filters/client_channel/server_address.h +108 -0
- data/src/core/ext/filters/client_channel/subchannel.cc +10 -8
- data/src/core/ext/filters/client_channel/subchannel.h +9 -6
- data/src/core/ext/filters/client_channel/subchannel_index.cc +20 -27
- data/src/core/ext/transport/chttp2/client/chttp2_connector.cc +3 -2
- data/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc +8 -9
- data/src/core/ext/transport/chttp2/server/chttp2_server.cc +1 -1
- data/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc +1 -1
- data/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc +8 -11
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.cc +24 -54
- data/src/core/ext/transport/chttp2/transport/chttp2_transport.h +3 -1
- data/src/core/ext/transport/chttp2/transport/context_list.cc +67 -0
- data/src/core/ext/transport/chttp2/transport/context_list.h +53 -0
- data/src/core/ext/transport/chttp2/transport/internal.h +38 -11
- data/src/core/ext/transport/chttp2/transport/writing.cc +5 -0
- data/src/core/ext/transport/inproc/inproc_transport.cc +1 -1
- data/src/core/lib/channel/channelz.cc +19 -18
- data/src/core/lib/channel/channelz.h +7 -1
- data/src/core/lib/channel/channelz_registry.cc +3 -2
- data/src/core/lib/debug/trace.cc +3 -0
- data/src/core/lib/debug/trace.h +5 -3
- data/src/core/lib/gpr/sync_posix.cc +96 -4
- data/src/core/lib/gprpp/inlined_vector.h +25 -19
- data/src/core/lib/gprpp/memory.h +2 -11
- data/src/core/lib/gprpp/orphanable.h +18 -82
- data/src/core/lib/gprpp/ref_counted.h +75 -84
- data/src/core/lib/gprpp/ref_counted_ptr.h +22 -17
- data/src/core/lib/http/httpcli_security_connector.cc +101 -94
- data/src/core/lib/http/parser.h +5 -5
- data/src/core/lib/iomgr/buffer_list.cc +16 -5
- data/src/core/lib/iomgr/buffer_list.h +10 -3
- data/src/core/lib/iomgr/call_combiner.cc +50 -2
- data/src/core/lib/iomgr/call_combiner.h +29 -2
- data/src/core/lib/iomgr/dynamic_annotations.h +67 -0
- data/src/core/lib/iomgr/endpoint.cc +4 -0
- data/src/core/lib/iomgr/endpoint.h +3 -0
- data/src/core/lib/iomgr/endpoint_pair_posix.cc +2 -2
- data/src/core/lib/iomgr/ev_epoll1_linux.cc +4 -0
- data/src/core/lib/iomgr/ev_epollex_linux.cc +4 -0
- data/src/core/lib/iomgr/ev_poll_posix.cc +4 -0
- data/src/core/lib/iomgr/ev_posix.cc +15 -7
- data/src/core/lib/iomgr/ev_posix.h +10 -0
- data/src/core/lib/iomgr/exec_ctx.cc +13 -0
- data/src/core/lib/iomgr/fork_posix.cc +1 -1
- data/src/core/lib/iomgr/internal_errqueue.cc +36 -3
- data/src/core/lib/iomgr/internal_errqueue.h +7 -1
- data/src/core/lib/iomgr/iomgr.cc +7 -0
- data/src/core/lib/iomgr/iomgr.h +4 -0
- data/src/core/lib/iomgr/iomgr_custom.cc +3 -1
- data/src/core/lib/iomgr/iomgr_internal.cc +4 -0
- data/src/core/lib/iomgr/iomgr_internal.h +4 -0
- data/src/core/lib/iomgr/iomgr_posix.cc +6 -1
- data/src/core/lib/iomgr/iomgr_windows.cc +4 -1
- data/src/core/lib/iomgr/port.h +1 -2
- data/src/core/lib/iomgr/resource_quota.cc +1 -0
- data/src/core/lib/iomgr/sockaddr_utils.cc +1 -0
- data/src/core/lib/iomgr/tcp_custom.cc +4 -1
- data/src/core/lib/iomgr/tcp_posix.cc +95 -35
- data/src/core/lib/iomgr/tcp_windows.cc +4 -1
- data/src/core/lib/iomgr/timer_manager.cc +6 -0
- data/src/core/lib/security/context/security_context.cc +75 -108
- data/src/core/lib/security/context/security_context.h +59 -35
- data/src/core/lib/security/credentials/alts/alts_credentials.cc +36 -48
- data/src/core/lib/security/credentials/alts/alts_credentials.h +37 -10
- data/src/core/lib/security/credentials/composite/composite_credentials.cc +97 -157
- data/src/core/lib/security/credentials/composite/composite_credentials.h +60 -24
- data/src/core/lib/security/credentials/credentials.cc +18 -142
- data/src/core/lib/security/credentials/credentials.h +119 -95
- data/src/core/lib/security/credentials/fake/fake_credentials.cc +46 -71
- data/src/core/lib/security/credentials/fake/fake_credentials.h +23 -5
- data/src/core/lib/security/credentials/google_default/google_default_credentials.cc +144 -51
- data/src/core/lib/security/credentials/google_default/google_default_credentials.h +28 -5
- data/src/core/lib/security/credentials/iam/iam_credentials.cc +27 -35
- data/src/core/lib/security/credentials/iam/iam_credentials.h +18 -4
- data/src/core/lib/security/credentials/jwt/jwt_credentials.cc +60 -69
- data/src/core/lib/security/credentials/jwt/jwt_credentials.h +29 -10
- data/src/core/lib/security/credentials/jwt/jwt_verifier.cc +2 -0
- data/src/core/lib/security/credentials/local/local_credentials.cc +19 -32
- data/src/core/lib/security/credentials/local/local_credentials.h +32 -11
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.cc +130 -149
- data/src/core/lib/security/credentials/oauth2/oauth2_credentials.h +74 -29
- data/src/core/lib/security/credentials/plugin/plugin_credentials.cc +59 -77
- data/src/core/lib/security/credentials/plugin/plugin_credentials.h +40 -17
- data/src/core/lib/security/credentials/ssl/ssl_credentials.cc +66 -83
- data/src/core/lib/security/credentials/ssl/ssl_credentials.h +58 -15
- data/src/core/lib/security/security_connector/alts/alts_security_connector.cc +152 -177
- data/src/core/lib/security/security_connector/alts/alts_security_connector.h +12 -10
- data/src/core/lib/security/security_connector/fake/fake_security_connector.cc +210 -215
- data/src/core/lib/security/security_connector/fake/fake_security_connector.h +9 -6
- data/src/core/lib/security/security_connector/local/local_security_connector.cc +176 -169
- data/src/core/lib/security/security_connector/local/local_security_connector.h +10 -9
- data/src/core/lib/security/security_connector/security_connector.cc +41 -124
- data/src/core/lib/security/security_connector/security_connector.h +102 -105
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.cc +348 -370
- data/src/core/lib/security/security_connector/ssl/ssl_security_connector.h +14 -12
- data/src/core/lib/security/security_connector/ssl_utils.cc +13 -9
- data/src/core/lib/security/security_connector/ssl_utils.h +3 -1
- data/src/core/lib/security/transport/client_auth_filter.cc +50 -50
- data/src/core/lib/security/transport/secure_endpoint.cc +7 -1
- data/src/core/lib/security/transport/security_handshaker.cc +82 -66
- data/src/core/lib/security/transport/server_auth_filter.cc +15 -13
- data/src/core/lib/surface/init.cc +1 -0
- data/src/core/lib/surface/server.cc +13 -11
- data/src/core/lib/surface/server.h +6 -6
- data/src/core/lib/surface/version.cc +2 -2
- data/src/core/lib/transport/metadata.cc +1 -0
- data/src/core/lib/transport/static_metadata.cc +228 -221
- data/src/core/lib/transport/static_metadata.h +75 -71
- data/src/core/lib/transport/transport.cc +2 -1
- data/src/core/lib/transport/transport.h +5 -1
- data/src/core/tsi/alts/handshaker/alts_handshaker_client.cc +9 -2
- data/src/core/tsi/ssl_transport_security.cc +35 -24
- data/src/ruby/ext/grpc/rb_grpc_imports.generated.h +1 -1
- data/src/ruby/lib/grpc/generic/rpc_server.rb +61 -0
- data/src/ruby/lib/grpc/generic/service.rb +1 -1
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/checker.rb +2 -3
- data/src/ruby/spec/generic/rpc_server_spec.rb +22 -0
- data/src/ruby/spec/support/services.rb +1 -0
- metadata +37 -32
- data/src/core/ext/filters/client_channel/lb_policy_factory.cc +0 -163
@@ -42,6 +42,7 @@ typedef struct grpc_fd grpc_fd;
|
|
42
42
|
typedef struct grpc_event_engine_vtable {
|
43
43
|
size_t pollset_size;
|
44
44
|
bool can_track_err;
|
45
|
+
bool run_in_background;
|
45
46
|
|
46
47
|
grpc_fd* (*fd_create)(int fd, const char* name, bool track_err);
|
47
48
|
int (*fd_wrapped_fd)(grpc_fd* fd);
|
@@ -79,6 +80,7 @@ typedef struct grpc_event_engine_vtable {
|
|
79
80
|
void (*pollset_set_add_fd)(grpc_pollset_set* pollset_set, grpc_fd* fd);
|
80
81
|
void (*pollset_set_del_fd)(grpc_pollset_set* pollset_set, grpc_fd* fd);
|
81
82
|
|
83
|
+
void (*shutdown_background_closure)(void);
|
82
84
|
void (*shutdown_engine)(void);
|
83
85
|
} grpc_event_engine_vtable;
|
84
86
|
|
@@ -101,6 +103,11 @@ const char* grpc_get_poll_strategy_name();
|
|
101
103
|
*/
|
102
104
|
bool grpc_event_engine_can_track_errors();
|
103
105
|
|
106
|
+
/* Returns true if polling engine runs in the background, false otherwise.
|
107
|
+
* Currently only 'epollbg' runs in the background.
|
108
|
+
*/
|
109
|
+
bool grpc_event_engine_run_in_background();
|
110
|
+
|
104
111
|
/* Create a wrapped file descriptor.
|
105
112
|
Requires fd is a non-blocking file descriptor.
|
106
113
|
\a track_err if true means that error events would be tracked separately
|
@@ -174,6 +181,9 @@ void grpc_pollset_add_fd(grpc_pollset* pollset, struct grpc_fd* fd);
|
|
174
181
|
void grpc_pollset_set_add_fd(grpc_pollset_set* pollset_set, grpc_fd* fd);
|
175
182
|
void grpc_pollset_set_del_fd(grpc_pollset_set* pollset_set, grpc_fd* fd);
|
176
183
|
|
184
|
+
/* Shut down all the closures registered in the background poller. */
|
185
|
+
void grpc_shutdown_background_closure();
|
186
|
+
|
177
187
|
/* override to allow tests to hook poll() usage */
|
178
188
|
typedef int (*grpc_poll_function_type)(struct pollfd*, nfds_t, int);
|
179
189
|
extern grpc_poll_function_type grpc_poll_function;
|
@@ -53,6 +53,13 @@ static void exec_ctx_sched(grpc_closure* closure, grpc_error* error) {
|
|
53
53
|
|
54
54
|
static gpr_timespec g_start_time;
|
55
55
|
|
56
|
+
// For debug of the timer manager crash only.
|
57
|
+
// TODO (mxyan): remove after bug is fixed.
|
58
|
+
#ifdef GRPC_DEBUG_TIMER_MANAGER
|
59
|
+
extern int64_t g_start_time_sec;
|
60
|
+
extern int64_t g_start_time_nsec;
|
61
|
+
#endif // GRPC_DEBUG_TIMER_MANAGER
|
62
|
+
|
56
63
|
static grpc_millis timespec_to_millis_round_down(gpr_timespec ts) {
|
57
64
|
ts = gpr_time_sub(ts, g_start_time);
|
58
65
|
double x = GPR_MS_PER_SEC * static_cast<double>(ts.tv_sec) +
|
@@ -117,6 +124,12 @@ void ExecCtx::TestOnlyGlobalInit(gpr_timespec new_val) {
|
|
117
124
|
|
118
125
|
void ExecCtx::GlobalInit(void) {
|
119
126
|
g_start_time = gpr_now(GPR_CLOCK_MONOTONIC);
|
127
|
+
// For debug of the timer manager crash only.
|
128
|
+
// TODO (mxyan): remove after bug is fixed.
|
129
|
+
#ifdef GRPC_DEBUG_TIMER_MANAGER
|
130
|
+
g_start_time_sec = g_start_time.tv_sec;
|
131
|
+
g_start_time_nsec = g_start_time.tv_nsec;
|
132
|
+
#endif
|
120
133
|
gpr_tls_init(&exec_ctx_);
|
121
134
|
}
|
122
135
|
|
@@ -60,7 +60,7 @@ void grpc_prefork() {
|
|
60
60
|
}
|
61
61
|
if (strcmp(grpc_get_poll_strategy_name(), "epoll1") != 0 &&
|
62
62
|
strcmp(grpc_get_poll_strategy_name(), "poll") != 0) {
|
63
|
-
gpr_log(
|
63
|
+
gpr_log(GPR_INFO,
|
64
64
|
"Fork support is only compatible with the epoll1 and poll polling "
|
65
65
|
"strategies");
|
66
66
|
}
|
@@ -20,17 +20,50 @@
|
|
20
20
|
|
21
21
|
#include "src/core/lib/iomgr/port.h"
|
22
22
|
|
23
|
+
#include <grpc/impl/codegen/log.h>
|
23
24
|
#include "src/core/lib/iomgr/internal_errqueue.h"
|
24
25
|
|
25
26
|
#ifdef GRPC_POSIX_SOCKET_TCP
|
26
27
|
|
27
|
-
|
28
|
+
#include <errno.h>
|
29
|
+
#include <stdlib.h>
|
30
|
+
#include <string.h>
|
31
|
+
#include <sys/utsname.h>
|
32
|
+
|
33
|
+
namespace grpc_core {
|
34
|
+
static bool errqueue_supported = false;
|
35
|
+
|
36
|
+
bool kernel_supports_errqueue() { return errqueue_supported; }
|
37
|
+
|
38
|
+
void grpc_errqueue_init() {
|
39
|
+
/* Both-compile time and run-time linux kernel versions should be atleast 4.0.0
|
40
|
+
*/
|
28
41
|
#ifdef LINUX_VERSION_CODE
|
29
42
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
|
30
|
-
|
43
|
+
struct utsname buffer;
|
44
|
+
if (uname(&buffer) != 0) {
|
45
|
+
gpr_log(GPR_ERROR, "uname: %s", strerror(errno));
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
char* release = buffer.release;
|
49
|
+
if (release == nullptr) {
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
|
53
|
+
if (strtol(release, nullptr, 10) >= 4) {
|
54
|
+
errqueue_supported = true;
|
55
|
+
} else {
|
56
|
+
gpr_log(GPR_DEBUG, "ERRQUEUE support not enabled");
|
57
|
+
}
|
31
58
|
#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(4, 0, 0) */
|
32
59
|
#endif /* LINUX_VERSION_CODE */
|
33
|
-
return false;
|
34
60
|
}
|
61
|
+
} /* namespace grpc_core */
|
62
|
+
|
63
|
+
#else
|
64
|
+
|
65
|
+
namespace grpc_core {
|
66
|
+
void grpc_errqueue_init() {}
|
67
|
+
} /* namespace grpc_core */
|
35
68
|
|
36
69
|
#endif /* GRPC_POSIX_SOCKET_TCP */
|
@@ -76,8 +76,14 @@ constexpr uint32_t kTimestampingRecordingOptions =
|
|
76
76
|
* Currently allowing only linux kernels above 4.0.0
|
77
77
|
*/
|
78
78
|
bool kernel_supports_errqueue();
|
79
|
-
|
79
|
+
|
80
|
+
} /* namespace grpc_core */
|
80
81
|
|
81
82
|
#endif /* GRPC_POSIX_SOCKET_TCP */
|
82
83
|
|
84
|
+
namespace grpc_core {
|
85
|
+
/* Initializes errqueue support */
|
86
|
+
void grpc_errqueue_init();
|
87
|
+
} /* namespace grpc_core */
|
88
|
+
|
83
89
|
#endif /* GRPC_CORE_LIB_IOMGR_INTERNAL_ERRQUEUE_H */
|
data/src/core/lib/iomgr/iomgr.cc
CHANGED
@@ -33,8 +33,10 @@
|
|
33
33
|
#include "src/core/lib/gpr/string.h"
|
34
34
|
#include "src/core/lib/gpr/useful.h"
|
35
35
|
#include "src/core/lib/gprpp/thd.h"
|
36
|
+
#include "src/core/lib/iomgr/buffer_list.h"
|
36
37
|
#include "src/core/lib/iomgr/exec_ctx.h"
|
37
38
|
#include "src/core/lib/iomgr/executor.h"
|
39
|
+
#include "src/core/lib/iomgr/internal_errqueue.h"
|
38
40
|
#include "src/core/lib/iomgr/iomgr_internal.h"
|
39
41
|
#include "src/core/lib/iomgr/network_status_tracker.h"
|
40
42
|
#include "src/core/lib/iomgr/timer.h"
|
@@ -57,6 +59,7 @@ void grpc_iomgr_init() {
|
|
57
59
|
g_root_object.name = (char*)"root";
|
58
60
|
grpc_network_status_init();
|
59
61
|
grpc_iomgr_platform_init();
|
62
|
+
grpc_core::grpc_errqueue_init();
|
60
63
|
}
|
61
64
|
|
62
65
|
void grpc_iomgr_start() { grpc_timer_manager_init(); }
|
@@ -154,6 +157,10 @@ void grpc_iomgr_shutdown() {
|
|
154
157
|
gpr_cv_destroy(&g_rcv);
|
155
158
|
}
|
156
159
|
|
160
|
+
void grpc_iomgr_shutdown_background_closure() {
|
161
|
+
grpc_iomgr_platform_shutdown_background_closure();
|
162
|
+
}
|
163
|
+
|
157
164
|
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name) {
|
158
165
|
obj->name = gpr_strdup(name);
|
159
166
|
gpr_mu_lock(&g_mu);
|
data/src/core/lib/iomgr/iomgr.h
CHANGED
@@ -35,6 +35,10 @@ void grpc_iomgr_start();
|
|
35
35
|
* exec_ctx. */
|
36
36
|
void grpc_iomgr_shutdown();
|
37
37
|
|
38
|
+
/** Signals the intention to shutdown all the closures registered in the
|
39
|
+
* background poller. */
|
40
|
+
void grpc_iomgr_shutdown_background_closure();
|
41
|
+
|
38
42
|
/* Exposed only for testing */
|
39
43
|
size_t grpc_iomgr_count_objects_for_testing();
|
40
44
|
|
@@ -40,9 +40,11 @@ static void iomgr_platform_init(void) {
|
|
40
40
|
}
|
41
41
|
static void iomgr_platform_flush(void) {}
|
42
42
|
static void iomgr_platform_shutdown(void) { grpc_pollset_global_shutdown(); }
|
43
|
+
static void iomgr_platform_shutdown_background_closure(void) {}
|
43
44
|
|
44
45
|
static grpc_iomgr_platform_vtable vtable = {
|
45
|
-
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown
|
46
|
+
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
|
47
|
+
iomgr_platform_shutdown_background_closure};
|
46
48
|
|
47
49
|
void grpc_custom_iomgr_init(grpc_socket_vtable* socket,
|
48
50
|
grpc_custom_resolver_vtable* resolver,
|
@@ -41,3 +41,7 @@ void grpc_iomgr_platform_init() { iomgr_platform_vtable->init(); }
|
|
41
41
|
void grpc_iomgr_platform_flush() { iomgr_platform_vtable->flush(); }
|
42
42
|
|
43
43
|
void grpc_iomgr_platform_shutdown() { iomgr_platform_vtable->shutdown(); }
|
44
|
+
|
45
|
+
void grpc_iomgr_platform_shutdown_background_closure() {
|
46
|
+
iomgr_platform_vtable->shutdown_background_closure();
|
47
|
+
}
|
@@ -35,6 +35,7 @@ typedef struct grpc_iomgr_platform_vtable {
|
|
35
35
|
void (*init)(void);
|
36
36
|
void (*flush)(void);
|
37
37
|
void (*shutdown)(void);
|
38
|
+
void (*shutdown_background_closure)(void);
|
38
39
|
} grpc_iomgr_platform_vtable;
|
39
40
|
|
40
41
|
void grpc_iomgr_register_object(grpc_iomgr_object* obj, const char* name);
|
@@ -52,6 +53,9 @@ void grpc_iomgr_platform_flush(void);
|
|
52
53
|
/** tear down all platform specific global iomgr structures */
|
53
54
|
void grpc_iomgr_platform_shutdown(void);
|
54
55
|
|
56
|
+
/** shut down all the closures registered in the background poller */
|
57
|
+
void grpc_iomgr_platform_shutdown_background_closure(void);
|
58
|
+
|
55
59
|
bool grpc_iomgr_abort_on_leaks(void);
|
56
60
|
|
57
61
|
#endif /* GRPC_CORE_LIB_IOMGR_IOMGR_INTERNAL_H */
|
@@ -51,8 +51,13 @@ static void iomgr_platform_shutdown(void) {
|
|
51
51
|
grpc_wakeup_fd_global_destroy();
|
52
52
|
}
|
53
53
|
|
54
|
+
static void iomgr_platform_shutdown_background_closure(void) {
|
55
|
+
grpc_shutdown_background_closure();
|
56
|
+
}
|
57
|
+
|
54
58
|
static grpc_iomgr_platform_vtable vtable = {
|
55
|
-
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown
|
59
|
+
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
|
60
|
+
iomgr_platform_shutdown_background_closure};
|
56
61
|
|
57
62
|
void grpc_set_default_iomgr_platform() {
|
58
63
|
grpc_set_tcp_client_impl(&grpc_posix_tcp_client_vtable);
|
@@ -71,8 +71,11 @@ static void iomgr_platform_shutdown(void) {
|
|
71
71
|
winsock_shutdown();
|
72
72
|
}
|
73
73
|
|
74
|
+
static void iomgr_platform_shutdown_background_closure(void) {}
|
75
|
+
|
74
76
|
static grpc_iomgr_platform_vtable vtable = {
|
75
|
-
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown
|
77
|
+
iomgr_platform_init, iomgr_platform_flush, iomgr_platform_shutdown,
|
78
|
+
iomgr_platform_shutdown_background_closure};
|
76
79
|
|
77
80
|
void grpc_set_default_iomgr_platform() {
|
78
81
|
grpc_set_tcp_client_impl(&grpc_windows_tcp_client_vtable);
|
data/src/core/lib/iomgr/port.h
CHANGED
@@ -62,8 +62,7 @@
|
|
62
62
|
#define GRPC_HAVE_UNIX_SOCKET 1
|
63
63
|
#ifdef LINUX_VERSION_CODE
|
64
64
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
|
65
|
-
|
66
|
-
#define GRPC_LINUX_ERRQUEUE 1 */
|
65
|
+
#define GRPC_LINUX_ERRQUEUE 1
|
67
66
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) */
|
68
67
|
#endif /* LINUX_VERSION_CODE */
|
69
68
|
#define GRPC_LINUX_MULTIPOLL_WITH_EPOLL 1
|
@@ -665,6 +665,7 @@ void grpc_resource_quota_unref_internal(grpc_resource_quota* resource_quota) {
|
|
665
665
|
GPR_ASSERT(resource_quota->num_threads_allocated == 0);
|
666
666
|
GRPC_COMBINER_UNREF(resource_quota->combiner, "resource_quota");
|
667
667
|
gpr_free(resource_quota->name);
|
668
|
+
gpr_mu_destroy(&resource_quota->thread_count_mu);
|
668
669
|
gpr_free(resource_quota);
|
669
670
|
}
|
670
671
|
}
|
@@ -217,6 +217,7 @@ void grpc_string_to_sockaddr(grpc_resolved_address* out, char* addr, int port) {
|
|
217
217
|
}
|
218
218
|
|
219
219
|
char* grpc_sockaddr_to_uri(const grpc_resolved_address* resolved_addr) {
|
220
|
+
if (resolved_addr->len == 0) return nullptr;
|
220
221
|
grpc_resolved_address addr_normalized;
|
221
222
|
if (grpc_sockaddr_is_v4mapped(resolved_addr, &addr_normalized)) {
|
222
223
|
resolved_addr = &addr_normalized;
|
@@ -326,6 +326,8 @@ static grpc_resource_user* endpoint_get_resource_user(grpc_endpoint* ep) {
|
|
326
326
|
|
327
327
|
static int endpoint_get_fd(grpc_endpoint* ep) { return -1; }
|
328
328
|
|
329
|
+
static bool endpoint_can_track_err(grpc_endpoint* ep) { return false; }
|
330
|
+
|
329
331
|
static grpc_endpoint_vtable vtable = {endpoint_read,
|
330
332
|
endpoint_write,
|
331
333
|
endpoint_add_to_pollset,
|
@@ -335,7 +337,8 @@ static grpc_endpoint_vtable vtable = {endpoint_read,
|
|
335
337
|
endpoint_destroy,
|
336
338
|
endpoint_get_resource_user,
|
337
339
|
endpoint_get_peer,
|
338
|
-
endpoint_get_fd
|
340
|
+
endpoint_get_fd,
|
341
|
+
endpoint_can_track_err};
|
339
342
|
|
340
343
|
grpc_endpoint* custom_tcp_endpoint_create(grpc_custom_socket* socket,
|
341
344
|
grpc_resource_quota* resource_quota,
|
@@ -126,6 +126,7 @@ struct grpc_tcp {
|
|
126
126
|
int bytes_counter;
|
127
127
|
bool socket_ts_enabled; /* True if timestamping options are set on the socket
|
128
128
|
*/
|
129
|
+
bool ts_capable; /* Cache whether we can set timestamping options */
|
129
130
|
gpr_atm
|
130
131
|
stop_error_notification; /* Set to 1 if we do not want to be notified on
|
131
132
|
errors anymore */
|
@@ -260,10 +261,17 @@ static void notify_on_write(grpc_tcp* tcp) {
|
|
260
261
|
if (grpc_tcp_trace.enabled()) {
|
261
262
|
gpr_log(GPR_INFO, "TCP:%p notify_on_write", tcp);
|
262
263
|
}
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
264
|
+
if (grpc_event_engine_run_in_background()) {
|
265
|
+
// If there is a polling engine always running in the background, there is
|
266
|
+
// no need to run the backup poller.
|
267
|
+
GRPC_CLOSURE_INIT(&tcp->write_done_closure, tcp_handle_write, tcp,
|
268
|
+
grpc_schedule_on_exec_ctx);
|
269
|
+
} else {
|
270
|
+
cover_self(tcp);
|
271
|
+
GRPC_CLOSURE_INIT(&tcp->write_done_closure,
|
272
|
+
tcp_drop_uncovered_then_handle_write, tcp,
|
273
|
+
grpc_schedule_on_exec_ctx);
|
274
|
+
}
|
267
275
|
grpc_fd_notify_on_write(tcp->em_fd, &tcp->write_done_closure);
|
268
276
|
}
|
269
277
|
|
@@ -384,6 +392,12 @@ static void tcp_destroy(grpc_endpoint* ep) {
|
|
384
392
|
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
|
385
393
|
grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
|
386
394
|
if (grpc_event_engine_can_track_errors()) {
|
395
|
+
gpr_mu_lock(&tcp->tb_mu);
|
396
|
+
grpc_core::TracedBuffer::Shutdown(
|
397
|
+
&tcp->tb_head, tcp->outgoing_buffer_arg,
|
398
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("endpoint destroyed"));
|
399
|
+
gpr_mu_unlock(&tcp->tb_mu);
|
400
|
+
tcp->outgoing_buffer_arg = nullptr;
|
387
401
|
gpr_atm_no_barrier_store(&tcp->stop_error_notification, true);
|
388
402
|
grpc_fd_set_error(tcp->em_fd);
|
389
403
|
}
|
@@ -576,7 +590,7 @@ ssize_t tcp_send(int fd, const struct msghdr* msg) {
|
|
576
590
|
*/
|
577
591
|
static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
|
578
592
|
size_t sending_length,
|
579
|
-
ssize_t* sent_length
|
593
|
+
ssize_t* sent_length);
|
580
594
|
|
581
595
|
/** The callback function to be invoked when we get an error on the socket. */
|
582
596
|
static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error);
|
@@ -584,13 +598,11 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error);
|
|
584
598
|
#ifdef GRPC_LINUX_ERRQUEUE
|
585
599
|
static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
|
586
600
|
size_t sending_length,
|
587
|
-
ssize_t* sent_length
|
588
|
-
grpc_error** error) {
|
601
|
+
ssize_t* sent_length) {
|
589
602
|
if (!tcp->socket_ts_enabled) {
|
590
603
|
uint32_t opt = grpc_core::kTimestampingSocketOptions;
|
591
604
|
if (setsockopt(tcp->fd, SOL_SOCKET, SO_TIMESTAMPING,
|
592
605
|
static_cast<void*>(&opt), sizeof(opt)) != 0) {
|
593
|
-
*error = tcp_annotate_error(GRPC_OS_ERROR(errno, "setsockopt"), tcp);
|
594
606
|
grpc_slice_buffer_reset_and_unref_internal(tcp->outgoing_buffer);
|
595
607
|
if (grpc_tcp_trace.enabled()) {
|
596
608
|
gpr_log(GPR_ERROR, "Failed to set timestamping options on the socket.");
|
@@ -621,7 +633,7 @@ static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
|
|
621
633
|
if (sending_length == static_cast<size_t>(length)) {
|
622
634
|
gpr_mu_lock(&tcp->tb_mu);
|
623
635
|
grpc_core::TracedBuffer::AddNewEntry(
|
624
|
-
&tcp->tb_head, static_cast<
|
636
|
+
&tcp->tb_head, static_cast<uint32_t>(tcp->bytes_counter + length),
|
625
637
|
tcp->outgoing_buffer_arg);
|
626
638
|
gpr_mu_unlock(&tcp->tb_mu);
|
627
639
|
tcp->outgoing_buffer_arg = nullptr;
|
@@ -673,11 +685,9 @@ struct cmsghdr* process_timestamp(grpc_tcp* tcp, msghdr* msg,
|
|
673
685
|
}
|
674
686
|
|
675
687
|
/** For linux platforms, reads the socket's error queue and processes error
|
676
|
-
* messages from the queue.
|
677
|
-
* timestamps. Returns false if any of the errors were not timestamps. For
|
678
|
-
* non-linux platforms, error processing is not used/enabled currently.
|
688
|
+
* messages from the queue.
|
679
689
|
*/
|
680
|
-
static
|
690
|
+
static void process_errors(grpc_tcp* tcp) {
|
681
691
|
while (true) {
|
682
692
|
struct iovec iov;
|
683
693
|
iov.iov_base = nullptr;
|
@@ -706,10 +716,10 @@ static bool process_errors(grpc_tcp* tcp) {
|
|
706
716
|
} while (r < 0 && saved_errno == EINTR);
|
707
717
|
|
708
718
|
if (r == -1 && saved_errno == EAGAIN) {
|
709
|
-
return
|
719
|
+
return; /* No more errors to process */
|
710
720
|
}
|
711
721
|
if (r == -1) {
|
712
|
-
return
|
722
|
+
return;
|
713
723
|
}
|
714
724
|
if (grpc_tcp_trace.enabled()) {
|
715
725
|
if ((msg.msg_flags & MSG_CTRUNC) == 1) {
|
@@ -719,8 +729,9 @@ static bool process_errors(grpc_tcp* tcp) {
|
|
719
729
|
|
720
730
|
if (msg.msg_controllen == 0) {
|
721
731
|
/* There was no control message found. It was probably spurious. */
|
722
|
-
return
|
732
|
+
return;
|
723
733
|
}
|
734
|
+
bool seen = false;
|
724
735
|
for (auto cmsg = CMSG_FIRSTHDR(&msg); cmsg && cmsg->cmsg_len;
|
725
736
|
cmsg = CMSG_NXTHDR(&msg, cmsg)) {
|
726
737
|
if (cmsg->cmsg_level != SOL_SOCKET ||
|
@@ -732,9 +743,13 @@ static bool process_errors(grpc_tcp* tcp) {
|
|
732
743
|
"unknown control message cmsg_level:%d cmsg_type:%d",
|
733
744
|
cmsg->cmsg_level, cmsg->cmsg_type);
|
734
745
|
}
|
735
|
-
return
|
746
|
+
return;
|
736
747
|
}
|
737
|
-
process_timestamp(tcp, &msg, cmsg);
|
748
|
+
cmsg = process_timestamp(tcp, &msg, cmsg);
|
749
|
+
seen = true;
|
750
|
+
}
|
751
|
+
if (!seen) {
|
752
|
+
return;
|
738
753
|
}
|
739
754
|
}
|
740
755
|
}
|
@@ -749,20 +764,17 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) {
|
|
749
764
|
static_cast<bool>(gpr_atm_acq_load(&tcp->stop_error_notification))) {
|
750
765
|
/* We aren't going to register to hear on error anymore, so it is safe to
|
751
766
|
* unref. */
|
752
|
-
grpc_core::TracedBuffer::Shutdown(&tcp->tb_head, GRPC_ERROR_REF(error));
|
753
767
|
TCP_UNREF(tcp, "error-tracking");
|
754
768
|
return;
|
755
769
|
}
|
756
770
|
|
757
771
|
/* We are still interested in collecting timestamps, so let's try reading
|
758
772
|
* them. */
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
grpc_fd_set_writable(tcp->em_fd);
|
765
|
-
}
|
773
|
+
process_errors(tcp);
|
774
|
+
/* This might not a timestamps error. Set the read and write closures to be
|
775
|
+
* ready. */
|
776
|
+
grpc_fd_set_readable(tcp->em_fd);
|
777
|
+
grpc_fd_set_writable(tcp->em_fd);
|
766
778
|
GRPC_CLOSURE_INIT(&tcp->error_closure, tcp_handle_error, tcp,
|
767
779
|
grpc_schedule_on_exec_ctx);
|
768
780
|
grpc_fd_notify_on_error(tcp->em_fd, &tcp->error_closure);
|
@@ -771,8 +783,7 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) {
|
|
771
783
|
#else /* GRPC_LINUX_ERRQUEUE */
|
772
784
|
static bool tcp_write_with_timestamps(grpc_tcp* tcp, struct msghdr* msg,
|
773
785
|
size_t sending_length,
|
774
|
-
ssize_t* sent_length
|
775
|
-
grpc_error** error) {
|
786
|
+
ssize_t* sent_length) {
|
776
787
|
gpr_log(GPR_ERROR, "Write with timestamps not supported for this platform");
|
777
788
|
GPR_ASSERT(0);
|
778
789
|
return false;
|
@@ -784,6 +795,19 @@ static void tcp_handle_error(void* arg /* grpc_tcp */, grpc_error* error) {
|
|
784
795
|
}
|
785
796
|
#endif /* GRPC_LINUX_ERRQUEUE */
|
786
797
|
|
798
|
+
/* If outgoing_buffer_arg is filled, shuts down the list early, so that any
|
799
|
+
* release operations needed can be performed on the arg */
|
800
|
+
void tcp_shutdown_buffer_list(grpc_tcp* tcp) {
|
801
|
+
if (tcp->outgoing_buffer_arg) {
|
802
|
+
gpr_mu_lock(&tcp->tb_mu);
|
803
|
+
grpc_core::TracedBuffer::Shutdown(
|
804
|
+
&tcp->tb_head, tcp->outgoing_buffer_arg,
|
805
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("TracedBuffer list shutdown"));
|
806
|
+
gpr_mu_unlock(&tcp->tb_mu);
|
807
|
+
tcp->outgoing_buffer_arg = nullptr;
|
808
|
+
}
|
809
|
+
}
|
810
|
+
|
787
811
|
/* returns true if done, false if pending; if returning true, *error is set */
|
788
812
|
#if defined(IOV_MAX) && IOV_MAX < 1000
|
789
813
|
#define MAX_WRITE_IOVEC IOV_MAX
|
@@ -794,7 +818,7 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
|
|
794
818
|
struct msghdr msg;
|
795
819
|
struct iovec iov[MAX_WRITE_IOVEC];
|
796
820
|
msg_iovlen_type iov_size;
|
797
|
-
ssize_t sent_length;
|
821
|
+
ssize_t sent_length = 0;
|
798
822
|
size_t sending_length;
|
799
823
|
size_t trailing;
|
800
824
|
size_t unwind_slice_idx;
|
@@ -829,11 +853,19 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
|
|
829
853
|
msg.msg_iov = iov;
|
830
854
|
msg.msg_iovlen = iov_size;
|
831
855
|
msg.msg_flags = 0;
|
856
|
+
bool tried_sending_message = false;
|
832
857
|
if (tcp->outgoing_buffer_arg != nullptr) {
|
833
|
-
if (!
|
834
|
-
|
835
|
-
|
836
|
-
|
858
|
+
if (!tcp->ts_capable ||
|
859
|
+
!tcp_write_with_timestamps(tcp, &msg, sending_length, &sent_length)) {
|
860
|
+
/* We could not set socket options to collect Fathom timestamps.
|
861
|
+
* Fallback on writing without timestamps. */
|
862
|
+
tcp->ts_capable = false;
|
863
|
+
tcp_shutdown_buffer_list(tcp);
|
864
|
+
} else {
|
865
|
+
tried_sending_message = true;
|
866
|
+
}
|
867
|
+
}
|
868
|
+
if (!tried_sending_message) {
|
837
869
|
msg.msg_control = nullptr;
|
838
870
|
msg.msg_controllen = 0;
|
839
871
|
|
@@ -856,10 +888,12 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error** error) {
|
|
856
888
|
} else if (errno == EPIPE) {
|
857
889
|
*error = tcp_annotate_error(GRPC_OS_ERROR(errno, "sendmsg"), tcp);
|
858
890
|
grpc_slice_buffer_reset_and_unref_internal(tcp->outgoing_buffer);
|
891
|
+
tcp_shutdown_buffer_list(tcp);
|
859
892
|
return true;
|
860
893
|
} else {
|
861
894
|
*error = tcp_annotate_error(GRPC_OS_ERROR(errno, "sendmsg"), tcp);
|
862
895
|
grpc_slice_buffer_reset_and_unref_internal(tcp->outgoing_buffer);
|
896
|
+
tcp_shutdown_buffer_list(tcp);
|
863
897
|
return true;
|
864
898
|
}
|
865
899
|
}
|
@@ -936,17 +970,18 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
|
|
936
970
|
|
937
971
|
GPR_ASSERT(tcp->write_cb == nullptr);
|
938
972
|
|
973
|
+
tcp->outgoing_buffer_arg = arg;
|
939
974
|
if (buf->length == 0) {
|
940
975
|
GRPC_CLOSURE_SCHED(
|
941
976
|
cb, grpc_fd_is_shutdown(tcp->em_fd)
|
942
977
|
? tcp_annotate_error(
|
943
978
|
GRPC_ERROR_CREATE_FROM_STATIC_STRING("EOF"), tcp)
|
944
979
|
: GRPC_ERROR_NONE);
|
980
|
+
tcp_shutdown_buffer_list(tcp);
|
945
981
|
return;
|
946
982
|
}
|
947
983
|
tcp->outgoing_buffer = buf;
|
948
984
|
tcp->outgoing_byte_idx = 0;
|
949
|
-
tcp->outgoing_buffer_arg = arg;
|
950
985
|
if (arg) {
|
951
986
|
GPR_ASSERT(grpc_event_engine_can_track_errors());
|
952
987
|
}
|
@@ -999,6 +1034,22 @@ static grpc_resource_user* tcp_get_resource_user(grpc_endpoint* ep) {
|
|
999
1034
|
return tcp->resource_user;
|
1000
1035
|
}
|
1001
1036
|
|
1037
|
+
static bool tcp_can_track_err(grpc_endpoint* ep) {
|
1038
|
+
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
|
1039
|
+
if (!grpc_event_engine_can_track_errors()) {
|
1040
|
+
return false;
|
1041
|
+
}
|
1042
|
+
struct sockaddr addr;
|
1043
|
+
socklen_t len = sizeof(addr);
|
1044
|
+
if (getsockname(tcp->fd, &addr, &len) < 0) {
|
1045
|
+
return false;
|
1046
|
+
}
|
1047
|
+
if (addr.sa_family == AF_INET || addr.sa_family == AF_INET6) {
|
1048
|
+
return true;
|
1049
|
+
}
|
1050
|
+
return false;
|
1051
|
+
}
|
1052
|
+
|
1002
1053
|
static const grpc_endpoint_vtable vtable = {tcp_read,
|
1003
1054
|
tcp_write,
|
1004
1055
|
tcp_add_to_pollset,
|
@@ -1008,7 +1059,8 @@ static const grpc_endpoint_vtable vtable = {tcp_read,
|
|
1008
1059
|
tcp_destroy,
|
1009
1060
|
tcp_get_resource_user,
|
1010
1061
|
tcp_get_peer,
|
1011
|
-
tcp_get_fd
|
1062
|
+
tcp_get_fd,
|
1063
|
+
tcp_can_track_err};
|
1012
1064
|
|
1013
1065
|
#define MAX_CHUNK_SIZE 32 * 1024 * 1024
|
1014
1066
|
|
@@ -1069,6 +1121,8 @@ grpc_endpoint* grpc_tcp_create(grpc_fd* em_fd,
|
|
1069
1121
|
tcp->is_first_read = true;
|
1070
1122
|
tcp->bytes_counter = -1;
|
1071
1123
|
tcp->socket_ts_enabled = false;
|
1124
|
+
tcp->ts_capable = true;
|
1125
|
+
tcp->outgoing_buffer_arg = nullptr;
|
1072
1126
|
/* paired with unref in grpc_tcp_destroy */
|
1073
1127
|
gpr_ref_init(&tcp->refcount, 1);
|
1074
1128
|
gpr_atm_no_barrier_store(&tcp->shutdown_count, 0);
|
@@ -1113,6 +1167,12 @@ void grpc_tcp_destroy_and_release_fd(grpc_endpoint* ep, int* fd,
|
|
1113
1167
|
grpc_slice_buffer_reset_and_unref_internal(&tcp->last_read_buffer);
|
1114
1168
|
if (grpc_event_engine_can_track_errors()) {
|
1115
1169
|
/* Stop errors notification. */
|
1170
|
+
gpr_mu_lock(&tcp->tb_mu);
|
1171
|
+
grpc_core::TracedBuffer::Shutdown(
|
1172
|
+
&tcp->tb_head, tcp->outgoing_buffer_arg,
|
1173
|
+
GRPC_ERROR_CREATE_FROM_STATIC_STRING("endpoint destroyed"));
|
1174
|
+
gpr_mu_unlock(&tcp->tb_mu);
|
1175
|
+
tcp->outgoing_buffer_arg = nullptr;
|
1116
1176
|
gpr_atm_no_barrier_store(&tcp->stop_error_notification, true);
|
1117
1177
|
grpc_fd_set_error(tcp->em_fd);
|
1118
1178
|
}
|