stranded_event_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2020 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
21 #include <stdlib.h>
22 #include <string.h>
23 
24 #include <functional>
25 #include <set>
26 #include <thread>
27 
28 #include <gmock/gmock.h>
29 
30 #include "absl/strings/str_cat.h"
31 #include "absl/strings/str_format.h"
32 #include "absl/types/optional.h"
33 
34 #include <grpc/grpc.h>
35 #include <grpc/grpc_security.h>
37 #include <grpc/slice.h>
38 #include <grpc/support/alloc.h>
39 #include <grpc/support/log.h>
41 #include <grpc/support/time.h>
42 
47 #include "src/core/lib/gprpp/thd.h"
55 #include "test/core/util/port.h"
57 
58 namespace {
59 
60 const int kNumMessagePingPongsPerCall = 4000;
61 
62 struct TestCall {
63  explicit TestCall(grpc_channel* channel, grpc_call* call,
65  : channel(channel), call(call), cq(cq) {}
66 
67  TestCall(const TestCall& other) = delete;
68  TestCall& operator=(const TestCall& other) = delete;
69 
70  ~TestCall() {
71  grpc_call_cancel(call, nullptr);
76  nullptr)
78  }
80  }
81 
83  grpc_call* call;
86  status; // filled in when the call is finished
87 };
88 
89 void StartCall(TestCall* test_call) {
90  grpc_op ops[6];
91  grpc_op* op;
92  memset(ops, 0, sizeof(ops));
93  op = ops;
97  op->reserved = nullptr;
98  op++;
99  void* tag = test_call;
101  test_call->call, ops, static_cast<size_t>(op - ops), tag, nullptr);
103  cq_verifier* cqv = cq_verifier_create(test_call->cq);
104  CQ_EXPECT_COMPLETION(cqv, tag, 1);
105  cq_verify(cqv);
106  cq_verifier_destroy(cqv);
107 }
108 
109 void SendMessage(grpc_call* call, grpc_completion_queue* cq) {
110  grpc_slice request_payload_slice = grpc_slice_from_copied_string("a");
111  grpc_byte_buffer* request_payload =
112  grpc_raw_byte_buffer_create(&request_payload_slice, 1);
113  grpc_op ops[6];
114  grpc_op* op;
115  memset(ops, 0, sizeof(ops));
116  op = ops;
118  op->data.send_message.send_message = request_payload;
119  op->reserved = nullptr;
120  op++;
121  void* tag = call;
123  call, ops, static_cast<size_t>(op - ops), tag, nullptr);
126  CQ_EXPECT_COMPLETION(cqv, tag, 1);
127  cq_verify(cqv);
128  cq_verifier_destroy(cqv);
129  grpc_byte_buffer_destroy(request_payload);
130 }
131 
132 void ReceiveMessage(grpc_call* call, grpc_completion_queue* cq) {
133  grpc_byte_buffer* request_payload = nullptr;
134  grpc_op ops[6];
135  grpc_op* op;
136  memset(ops, 0, sizeof(ops));
137  op = ops;
139  op->data.recv_message.recv_message = &request_payload;
140  op->reserved = nullptr;
141  op++;
142  void* tag = call;
144  call, ops, static_cast<size_t>(op - ops), tag, nullptr);
147  CQ_EXPECT_COMPLETION(cqv, tag, 1);
148  cq_verify(cqv);
149  cq_verifier_destroy(cqv);
150  grpc_byte_buffer_destroy(request_payload);
151 }
152 
153 void ReceiveInitialMetadata(TestCall* test_call, gpr_timespec deadline) {
156  grpc_op ops[6];
157  grpc_op* op;
158  memset(ops, 0, sizeof(ops));
159  op = ops;
162  op->reserved = nullptr;
163  op++;
164  void* tag = test_call;
166  test_call->call, ops, static_cast<size_t>(op - ops), tag, nullptr);
168  grpc_event event =
169  grpc_completion_queue_next(test_call->cq, deadline, nullptr);
170  if (event.type != GRPC_OP_COMPLETE || !event.success) {
172  "Wanted op complete with success, got op type:%d success:%d",
173  event.type, event.success);
174  GPR_ASSERT(0);
175  }
176  GPR_ASSERT(event.tag == tag);
178 }
179 
180 void FinishCall(TestCall* test_call) {
181  grpc_op ops[6];
182  grpc_op* op;
187  memset(ops, 0, sizeof(ops));
188  op = ops;
193  op->flags = 0;
194  op->reserved = nullptr;
195  op++;
196  void* tag = test_call;
198  test_call->call, ops, static_cast<size_t>(op - ops), tag, nullptr);
201  test_call->cq, gpr_inf_future(GPR_CLOCK_REALTIME), nullptr);
202  GPR_ASSERT(event.type == GRPC_OP_COMPLETE);
203  GPR_ASSERT(event.success);
204  GPR_ASSERT(event.tag == tag);
205  test_call->status = status;
208 }
209 
210 class TestServer {
211  public:
212  explicit TestServer() {
214  server_ = grpc_server_create(nullptr, nullptr);
215  address_ =
218  grpc_server_credentials* server_creds =
220  GPR_ASSERT(
221  grpc_server_add_http2_port(server_, address_.c_str(), server_creds));
222  grpc_server_credentials_release(server_creds);
224  thread_ = std::thread(std::bind(&TestServer::AcceptThread, this));
225  }
226 
227  ~TestServer() {
228  thread_.join();
229  void* shutdown_and_notify_tag = this;
230  grpc_server_shutdown_and_notify(server_, cq_, shutdown_and_notify_tag);
233  GPR_ASSERT(event.type == GRPC_OP_COMPLETE);
234  GPR_ASSERT(event.tag == shutdown_and_notify_tag);
235  GPR_ASSERT(event.success);
239  nullptr)
241  }
243  }
244 
245  std::string address() const { return address_; }
246 
247  private:
248  void AcceptThread() {
253  void* tag = &call_details;
254  grpc_call* call;
260  GPR_ASSERT(event.type == GRPC_OP_COMPLETE);
261  GPR_ASSERT(event.success);
262  GPR_ASSERT(event.tag == tag);
263  grpc_op ops[6];
264  grpc_op* op;
265  memset(ops, 0, sizeof(ops));
266  op = ops;
269  op->reserved = nullptr;
270  op++;
271  error = grpc_call_start_batch(call, ops, static_cast<size_t>(op - ops), tag,
272  nullptr);
275  nullptr);
276  GPR_ASSERT(event.type == GRPC_OP_COMPLETE);
277  GPR_ASSERT(event.success);
278  GPR_ASSERT(event.tag == tag);
279  for (int i = 0; i < kNumMessagePingPongsPerCall; i++) {
280  ReceiveMessage(call, cq_);
281  SendMessage(call, cq_);
282  }
284  "test status", nullptr);
288  }
289 
294 };
295 
296 grpc_core::Resolver::Result BuildResolverResponse(
297  const std::vector<std::string>& addresses) {
299  result.addresses = grpc_core::ServerAddressList();
300  for (const auto& address_str : addresses) {
302  if (!uri.ok()) {
303  gpr_log(GPR_ERROR, "Failed to parse. Error: %s",
304  uri.status().ToString().c_str());
305  GPR_ASSERT(uri.ok());
306  }
307  grpc_resolved_address address;
308  GPR_ASSERT(grpc_parse_uri(*uri, &address));
309  result.addresses->emplace_back(address.addr, address.len, nullptr);
310  }
311  return result;
312 }
313 
314 // Perform a simple RPC where the server cancels the request with
315 // grpc_call_cancel_with_status
316 TEST(Pollers, TestReadabilityNotificationsDontGetStrandedOnOneCq) {
317  gpr_log(GPR_DEBUG, "test thread");
318  /* 64 is a somewhat arbitary number, the important thing is that it
319  * exceeds the value of MAX_EPOLL_EVENTS_HANDLED_EACH_POLL_CALL (16), which
320  * is enough to repro a bug at time of writing. */
321  const int kNumCalls = 64;
322  size_t ping_pong_round = 0;
323  size_t ping_pongs_done = 0;
324  grpc_core::Mutex ping_pong_round_mu;
325  grpc_core::CondVar ping_pong_round_cv;
326  const std::string kSharedUnconnectableAddress =
328  gpr_log(GPR_DEBUG, "created unconnectable address:%s",
329  kSharedUnconnectableAddress.c_str());
330  std::vector<std::thread> threads;
331  threads.reserve(kNumCalls);
332  std::vector<std::unique_ptr<TestServer>> test_servers;
333  // Instantiate servers inline here, so that we get port allocation out of the
334  // way and don't depend on it during the actual test. It can sometimes take
335  // time to allocate kNumCalls ports from the port server, and we don't want to
336  // hit test timeouts because of that.
337  test_servers.reserve(kNumCalls);
338  for (int i = 0; i < kNumCalls; i++) {
339  test_servers.push_back(absl::make_unique<TestServer>());
340  }
341  for (int i = 0; i < kNumCalls; i++) {
342  auto test_server = test_servers[i].get();
343  threads.push_back(std::thread([kSharedUnconnectableAddress,
344  &ping_pong_round, &ping_pongs_done,
345  &ping_pong_round_mu, &ping_pong_round_cv,
346  test_server]() {
347  gpr_log(GPR_DEBUG, "using test_server with address:%s",
348  test_server->address().c_str());
349  std::vector<grpc_arg> args;
350  grpc_arg service_config_arg;
351  service_config_arg.type = GRPC_ARG_STRING;
352  service_config_arg.key = const_cast<char*>(GRPC_ARG_SERVICE_CONFIG);
353  service_config_arg.value.string =
354  const_cast<char*>("{\"loadBalancingConfig\":[{\"round_robin\":{}}]}");
355  args.push_back(service_config_arg);
356  auto fake_resolver_response_generator =
357  grpc_core::MakeRefCounted<grpc_core::FakeResolverResponseGenerator>();
358  {
360  fake_resolver_response_generator->SetResponse(BuildResolverResponse(
361  {absl::StrCat("ipv4:", kSharedUnconnectableAddress),
362  absl::StrCat("ipv4:", test_server->address())}));
363  }
365  fake_resolver_response_generator.get()));
366  grpc_channel_args* channel_args =
367  grpc_channel_args_copy_and_add(nullptr, args.data(), args.size());
370  grpc_channel_create("fake:///test.server.com", creds, channel_args);
372  grpc_channel_args_destroy(channel_args);
377  grpc_slice_from_static_string("/foo"), nullptr,
379  auto test_call = absl::make_unique<TestCall>(channel, call, cq);
380  // Start a call, and ensure that round_robin load balancing is configured
381  StartCall(test_call.get());
382  // Make sure the test is doing what it's meant to be doing
383  grpc_channel_info channel_info;
384  memset(&channel_info, 0, sizeof(channel_info));
385  char* lb_policy_name = nullptr;
386  channel_info.lb_policy_name = &lb_policy_name;
387  grpc_channel_get_info(channel, &channel_info);
388  EXPECT_EQ(std::string(lb_policy_name), "round_robin")
389  << "not using round robin; this test has a low chance of hitting the "
390  "bug that it's meant to try to hit";
391  gpr_free(lb_policy_name);
392  // Receive initial metadata
394  "now receive initial metadata on call with server address:%s",
395  test_server->address().c_str());
396  ReceiveInitialMetadata(test_call.get(),
398  for (int i = 1; i <= kNumMessagePingPongsPerCall; i++) {
399  {
400  grpc_core::MutexLock lock(&ping_pong_round_mu);
401  ping_pong_round_cv.SignalAll();
402  while (int(ping_pong_round) != i) {
403  ping_pong_round_cv.Wait(&ping_pong_round_mu);
404  }
405  }
406  SendMessage(test_call->call, test_call->cq);
407  ReceiveMessage(test_call->call, test_call->cq);
408  {
409  grpc_core::MutexLock lock(&ping_pong_round_mu);
410  ping_pongs_done++;
411  ping_pong_round_cv.SignalAll();
412  }
413  }
414  gpr_log(GPR_DEBUG, "now receive status on call with server address:%s",
415  test_server->address().c_str());
416  FinishCall(test_call.get());
417  GPR_ASSERT(test_call->status.has_value());
418  GPR_ASSERT(test_call->status.value() == GRPC_STATUS_PERMISSION_DENIED);
419  {
421  fake_resolver_response_generator.reset();
422  }
423  }));
424  }
425  for (size_t i = 1; i <= kNumMessagePingPongsPerCall; i++) {
426  {
427  grpc_core::MutexLock lock(&ping_pong_round_mu);
428  while (ping_pongs_done < ping_pong_round * kNumCalls) {
429  ping_pong_round_cv.Wait(&ping_pong_round_mu);
430  }
431  ping_pong_round++;
432  ping_pong_round_cv.SignalAll();
433  gpr_log(GPR_DEBUG, "initiate ping pong round: %ld", ping_pong_round);
434  }
435  }
436  for (auto& thread : threads) {
437  thread.join();
438  }
439  gpr_log(GPR_DEBUG, "All RPCs completed!");
440 }
441 
442 } // namespace
443 
444 int main(int argc, char** argv) {
445  ::testing::InitGoogleTest(&argc, argv);
446  grpc::testing::TestEnvironment env(&argc, argv);
447  grpc_init();
448  auto result = RUN_ALL_TESTS();
449  grpc_shutdown();
450  return result;
451 }
grpc_arg
Definition: grpc_types.h:103
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
cq_
grpc_completion_queue * cq_
Definition: channel_connectivity.cc:210
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
grpc_op::grpc_op_data::grpc_op_send_message::send_message
struct grpc_byte_buffer * send_message
Definition: grpc_types.h:668
grpc_op::flags
uint32_t flags
Definition: grpc_types.h:644
grpc_call_error
grpc_call_error
Definition: grpc_types.h:464
grpc_call_cancel
GRPCAPI grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved)
Definition: call.cc:1782
grpc_call_details_destroy
GRPCAPI void grpc_call_details_destroy(grpc_call_details *details)
Definition: call_details.cc:36
grpc_core::CondVar
Definition: src/core/lib/gprpp/sync.h:126
grpc_call_details_init
GRPCAPI void grpc_call_details_init(grpc_call_details *details)
Definition: call_details.cc:30
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::trailing_metadata
grpc_metadata_array * trailing_metadata
Definition: grpc_types.h:701
grpc_timeout_seconds_to_deadline
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
Definition: test/core/util/test_config.cc:81
log.h
port.h
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::status
grpc_status_code * status
Definition: grpc_types.h:702
grpc_raw_byte_buffer_create
GRPCAPI grpc_byte_buffer * grpc_raw_byte_buffer_create(grpc_slice *slices, size_t nslices)
Definition: byte_buffer.cc:34
grpc_channel_get_info
GRPCAPI void grpc_channel_get_info(grpc_channel *channel, const grpc_channel_info *channel_info)
Definition: channel.cc:264
generate.env
env
Definition: generate.py:37
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
grpc_arg::value
union grpc_arg::grpc_arg_value value
memset
return memset(p, 0, total)
GRPC_ARG_STRING
@ GRPC_ARG_STRING
Definition: grpc_types.h:80
grpc_slice_from_copied_string
GPRAPI grpc_slice grpc_slice_from_copied_string(const char *source)
Definition: slice/slice.cc:177
grpc_op::grpc_op_data::send_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_send_initial_metadata send_initial_metadata
slice.h
grpc_metadata_array
Definition: grpc_types.h:579
grpc_call_details
Definition: grpc_types.h:585
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
grpc_op::reserved
void * reserved
Definition: grpc_types.h:646
string.h
GRPC_STATUS_PERMISSION_DENIED
@ GRPC_STATUS_PERMISSION_DENIED
Definition: include/grpc/impl/codegen/status.h:68
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
test_server
Definition: test_server.py:1
useful.h
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
fake_resolver.h
address_
ServerAddress address_
Definition: ring_hash.cc:194
grpc_status_code
grpc_status_code
Definition: include/grpc/impl/codegen/status.h:28
GRPC_QUEUE_SHUTDOWN
@ GRPC_QUEUE_SHUTDOWN
Definition: grpc_types.h:554
GRPC_OP_COMPLETE
@ GRPC_OP_COMPLETE
Definition: grpc_types.h:558
grpc_resolved_address
Definition: resolved_address.h:34
grpc_server_create
GRPCAPI grpc_server * grpc_server_create(const grpc_channel_args *args, void *reserved)
Definition: src/core/lib/surface/server.cc:1456
GRPC_CALL_OK
@ GRPC_CALL_OK
Definition: grpc_types.h:466
status
absl::Status status
Definition: rls.cc:251
grpc_server_register_completion_queue
GRPCAPI void grpc_server_register_completion_queue(grpc_server *server, grpc_completion_queue *cq, void *reserved)
Definition: src/core/lib/surface/server.cc:1466
gpr_inf_future
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
Definition: src/core/lib/gpr/time.cc:55
time.h
grpc_security.h
grpc_core::URI::Parse
static absl::StatusOr< URI > Parse(absl::string_view uri_text)
Definition: uri_parser.cc:209
credentials.h
grpc_channel_args
Definition: grpc_types.h:132
threads
static uv_thread_t * threads
Definition: threadpool.c:38
grpc_op::grpc_op_data::recv_message
struct grpc_op::grpc_op_data::grpc_op_recv_message recv_message
server_
Server *const server_
Definition: chttp2_server.cc:260
call
FilterStackCall * call
Definition: call.cc:750
grpc_op::data
union grpc_op::grpc_op_data data
EXPECT_EQ
#define EXPECT_EQ(a, b)
Definition: iomgr/time_averaged_stats_test.cc:27
grpc_types.h
alts_security_connector.h
grpc_insecure_server_credentials_create
GRPCAPI grpc_server_credentials * grpc_insecure_server_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:71
grpc_parse_uri
bool grpc_parse_uri(const grpc_core::URI &uri, grpc_resolved_address *resolved_addr)
Definition: parse_address.cc:293
grpc_metadata_array_destroy
GRPCAPI void grpc_metadata_array_destroy(grpc_metadata_array *array)
Definition: metadata_array.cc:35
grpc_op::grpc_op_data::grpc_op_recv_message::recv_message
struct grpc_byte_buffer ** recv_message
Definition: grpc_types.h:693
string_util.h
grpc_server_request_call
GRPCAPI grpc_call_error grpc_server_request_call(grpc_server *server, grpc_call **call, grpc_call_details *details, grpc_metadata_array *request_metadata, grpc_completion_queue *cq_bound_to_call, grpc_completion_queue *cq_for_notification, void *tag_new)
Definition: src/core/lib/surface/server.cc:1526
trailing_metadata_recv
static grpc_metadata_array trailing_metadata_recv
Definition: test/core/fling/client.cc:43
grpc_core::CondVar::SignalAll
void SignalAll()
Definition: src/core/lib/gprpp/sync.h:135
parse_address.h
channel
wrapped_grpc_channel * channel
Definition: src/php/ext/grpc/call.h:33
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
GRPC_INITIAL_METADATA_WAIT_FOR_READY
#define GRPC_INITIAL_METADATA_WAIT_FOR_READY
Definition: grpc_types.h:523
GRPC_OP_RECV_INITIAL_METADATA
@ GRPC_OP_RECV_INITIAL_METADATA
Definition: grpc_types.h:617
grpc_arg::grpc_arg_value::string
char * string
Definition: grpc_types.h:107
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
TEST
#define TEST(name, init_size,...)
Definition: arena_test.cc:75
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
grpc_server_credentials_release
GRPCAPI void grpc_server_credentials_release(grpc_server_credentials *creds)
Definition: credentials.cc:95
grpc_server_add_http2_port
GRPCAPI int grpc_server_add_http2_port(grpc_server *server, const char *addr, grpc_server_credentials *creds)
Definition: chttp2_server.cc:1029
grpc_call_unref
GRPCAPI void grpc_call_unref(grpc_call *call)
Definition: call.cc:1770
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc_event
Definition: grpc_types.h:564
grpc_completion_queue
Definition: completion_queue.cc:347
cq_verifier_destroy
void cq_verifier_destroy(cq_verifier *v)
Definition: cq_verifier.cc:92
grpc_core::Resolver::Result
Results returned by the resolver.
Definition: resolver/resolver.h:56
grpc.h
grpc_call
struct grpc_call grpc_call
Definition: grpc_types.h:70
grpc_byte_buffer
Definition: grpc_types.h:43
grpc_core::JoinHostPort
std::string JoinHostPort(absl::string_view host, int port)
Definition: host_port.cc:32
absl::optional
Definition: abseil-cpp/absl/types/internal/optional.h:61
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:64
grpc_op
Definition: grpc_types.h:640
GRPC_OP_SEND_MESSAGE
@ GRPC_OP_SEND_MESSAGE
Definition: grpc_types.h:602
grpc_channel_args_destroy
void grpc_channel_args_destroy(grpc_channel_args *a)
Definition: channel_args.cc:360
grpc_slice_from_static_string
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Definition: slice/slice.cc:89
cq_verifier_create
cq_verifier * cq_verifier_create(grpc_completion_queue *cq)
Definition: cq_verifier.cc:86
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
grpc_server
struct grpc_server grpc_server
Definition: grpc_types.h:65
cq_verifier
Definition: cq_verifier.cc:76
grpc_resolved_address::len
socklen_t len
Definition: resolved_address.h:36
request_metadata_recv
static grpc_metadata_array request_metadata_recv
Definition: test/core/fling/server.cc:48
error.h
grpc_server_destroy
GRPCAPI void grpc_server_destroy(grpc_server *server)
Definition: src/core/lib/surface/server.cc:1519
host_port.h
CQ_EXPECT_COMPLETION
#define CQ_EXPECT_COMPLETION(v, tag, success)
Definition: cq_verifier.h:58
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc_pick_unused_port_or_die
int grpc_pick_unused_port_or_die(void)
grpc_core::ServerAddressList
std::vector< ServerAddress > ServerAddressList
Definition: server_address.h:120
grpc_core::ExecCtx
Definition: exec_ctx.h:97
grpc_op::op
grpc_op_type op
Definition: grpc_types.h:642
grpc_op::grpc_op_data::grpc_op_send_initial_metadata::count
size_t count
Definition: grpc_types.h:653
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::status_details
grpc_slice * status_details
Definition: grpc_types.h:703
details
static grpc_slice details
Definition: test/core/fling/client.cc:46
test_config.h
grpc_channel_credentials_release
GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials *creds)
Definition: credentials.cc:36
grpc_channel_create_call
GRPCAPI grpc_call * grpc_channel_create_call(grpc_channel *channel, grpc_call *parent_call, uint32_t propagation_mask, grpc_completion_queue *completion_queue, grpc_slice method, const grpc_slice *host, gpr_timespec deadline, void *reserved)
Definition: channel.cc:311
GRPC_OP_RECV_MESSAGE
@ GRPC_OP_RECV_MESSAGE
Definition: grpc_types.h:621
grpc_server_credentials
Definition: src/core/lib/security/credentials/credentials.h:259
alts_credentials.h
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
grpc_core::Mutex
Definition: src/core/lib/gprpp/sync.h:61
grpc_channel_create
GRPCAPI grpc_channel * grpc_channel_create(const char *target, grpc_channel_credentials *creds, const grpc_channel_args *args)
Definition: chttp2_connector.cc:366
testing::InitGoogleTest
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: bloaty/third_party/googletest/googletest/src/gtest.cc:6106
GRPC_PROPAGATE_DEFAULTS
#define GRPC_PROPAGATE_DEFAULTS
Definition: propagation_bits.h:45
main
int main(int argc, char **argv)
Definition: stranded_event_test.cc:444
cq_verifier.h
GRPC_ARG_SERVICE_CONFIG
#define GRPC_ARG_SERVICE_CONFIG
Definition: grpc_types.h:304
grpc_completion_queue_destroy
GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq)
Definition: completion_queue.cc:1424
GRPC_OP_SEND_INITIAL_METADATA
@ GRPC_OP_SEND_INITIAL_METADATA
Definition: grpc_types.h:598
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_channel_info::lb_policy_name
char ** lb_policy_name
Definition: grpc_types.h:723
grpc_op::grpc_op_data::send_message
struct grpc_op::grpc_op_data::grpc_op_send_message send_message
alloc.h
grpc_op::grpc_op_data::recv_status_on_client
struct grpc_op::grpc_op_data::grpc_op_recv_status_on_client recv_status_on_client
grpc_core::CondVar::Wait
void Wait(Mutex *mu)
Definition: src/core/lib/gprpp/sync.h:137
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
grpc_arg::key
char * key
Definition: grpc_types.h:105
thd.h
grpc_server_shutdown_and_notify
GRPCAPI void grpc_server_shutdown_and_notify(grpc_server *server, grpc_completion_queue *cq, void *tag)
Definition: src/core/lib/surface/server.cc:1503
grpc_byte_buffer_destroy
GRPCAPI void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)
Definition: byte_buffer.cc:81
grpc_completion_queue_next
GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
Definition: completion_queue.cc:1133
cq_verify
void cq_verify(cq_verifier *v, int timeout_sec)
Definition: cq_verifier.cc:268
grpc_completion_queue_shutdown
GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
Definition: completion_queue.cc:1416
grpc_channel_destroy
GRPCAPI void grpc_channel_destroy(grpc_channel *channel)
Definition: channel.cc:437
grpc_channel
struct grpc_channel grpc_channel
Definition: grpc_types.h:62
GPR_DEBUG
#define GPR_DEBUG
Definition: include/grpc/impl/codegen/log.h:55
grpc_completion_queue_create_for_next
GRPCAPI grpc_completion_queue * grpc_completion_queue_create_for_next(void *reserved)
Definition: completion_queue_factory.cc:62
grpc_core::FakeResolverResponseGenerator::MakeChannelArg
static grpc_arg MakeChannelArg(FakeResolverResponseGenerator *generator)
Definition: fake_resolver.cc:338
grpc_op::grpc_op_data::recv_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_recv_initial_metadata recv_initial_metadata
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
uri_parser.h
gpr_timespec
Definition: gpr_types.h:50
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
grpc_server_start
GRPCAPI void grpc_server_start(grpc_server *server)
Definition: src/core/lib/surface/server.cc:1497
GRPC_OP_RECV_STATUS_ON_CLIENT
@ GRPC_OP_RECV_STATUS_ON_CLIENT
Definition: grpc_types.h:627
grpc_op::grpc_op_data::grpc_op_recv_initial_metadata::recv_initial_metadata
grpc_metadata_array * recv_initial_metadata
Definition: grpc_types.h:685
GPR_CLOCK_REALTIME
@ GPR_CLOCK_REALTIME
Definition: gpr_types.h:39
grpc_arg::type
grpc_arg_type type
Definition: grpc_types.h:104
grpc_channel_info
Definition: grpc_types.h:720
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
grpc_resolved_address::addr
char addr[GRPC_MAX_SOCKADDR_SIZE]
Definition: resolved_address.h:35
ops
static grpc_op ops[6]
Definition: test/core/fling/client.cc:39
initial_metadata_recv
static grpc_metadata_array initial_metadata_recv
Definition: test/core/fling/client.cc:42
grpc_call_start_batch
GRPCAPI grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, size_t nops, void *tag, void *reserved)
Definition: call.cc:1831
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_channel_credentials
Definition: src/core/lib/security/credentials/credentials.h:96
grpc_call_cancel_with_status
GRPCAPI grpc_call_error grpc_call_cancel_with_status(grpc_call *call, grpc_status_code status, const char *description, void *reserved)
Definition: call.cc:1791
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
cq
static grpc_completion_queue * cq
Definition: test/core/fling/client.cc:37
grpc_channel_args_copy_and_add
grpc_channel_args * grpc_channel_args_copy_and_add(const grpc_channel_args *src, const grpc_arg *to_add, size_t num_to_add)
Definition: channel_args.cc:224
slice_string_helpers.h
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
call_details
static grpc_call_details call_details
Definition: test/core/fling/server.cc:47
grpc_metadata_array_init
GRPCAPI void grpc_metadata_array_init(grpc_metadata_array *array)
Definition: metadata_array.cc:30
absl::StatusOr::status
const Status & status() const &
Definition: abseil-cpp/absl/status/statusor.h:678
thread_
std::unique_ptr< std::thread > thread_
Definition: settings_timeout_test.cc:104
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:20