streams_not_seen_test.cc
Go to the documentation of this file.
1 //
2 //
3 // Copyright 2022 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 <limits.h>
22 #include <stdlib.h>
23 #include <string.h>
24 
25 #include <thread>
26 
27 #include <gmock/gmock.h>
28 
29 #include "absl/synchronization/notification.h"
30 
31 #include <grpc/grpc.h>
32 #include <grpc/grpc_security.h>
33 
42 #include "test/core/util/port.h"
45 
46 namespace grpc_core {
47 namespace {
48 
49 void* Tag(intptr_t t) { return reinterpret_cast<void*>(t); }
50 
51 // A filter that records state about trailing metadata.
52 class TrailingMetadataRecordingFilter {
53  public:
55 
56  static bool trailing_metadata_available() {
58  }
59 
60  static void reset_trailing_metadata_available() {
62  }
63 
65  stream_network_state() {
66  return stream_network_state_;
67  }
68 
69  static void reset_stream_network_state() {
70  stream_network_state_ = absl::nullopt;
71  }
72 
73  static void reset_state() {
74  reset_trailing_metadata_available();
75  reset_stream_network_state();
76  }
77 
78  private:
79  class CallData {
80  public:
83  new (elem->call_data) CallData(args);
84  return GRPC_ERROR_NONE;
85  }
86 
87  static void Destroy(grpc_call_element* elem,
88  const grpc_call_final_info* /*final_info*/,
89  grpc_closure* /*ignored*/) {
90  auto* calld = static_cast<CallData*>(elem->call_data);
91  calld->~CallData();
92  }
93 
94  static void StartTransportStreamOpBatch(
96  auto* calld = static_cast<CallData*>(elem->call_data);
98  calld->trailing_metadata_available_ =
99  batch->payload->recv_initial_metadata.trailing_metadata_available;
100  calld->original_recv_initial_metadata_ready_ =
101  batch->payload->recv_initial_metadata.recv_initial_metadata_ready;
102  batch->payload->recv_initial_metadata.recv_initial_metadata_ready =
103  &calld->recv_initial_metadata_ready_;
104  }
106  calld->recv_trailing_metadata_ =
107  batch->payload->recv_trailing_metadata.recv_trailing_metadata;
108  calld->original_recv_trailing_metadata_ready_ =
109  batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready;
110  batch->payload->recv_trailing_metadata.recv_trailing_metadata_ready =
111  &calld->recv_trailing_metadata_ready_;
112  }
114  }
115 
116  private:
117  explicit CallData(const grpc_call_element_args* /*args*/) {
118  GRPC_CLOSURE_INIT(&recv_initial_metadata_ready_, RecvInitialMetadataReady,
119  this, nullptr);
121  RecvTrailingMetadataReady, this, nullptr);
122  }
123 
124  static void RecvInitialMetadataReady(void* arg, grpc_error_handle error) {
125  auto* calld = static_cast<CallData*>(arg);
127  *calld->trailing_metadata_available_;
128  Closure::Run(DEBUG_LOCATION, calld->original_recv_initial_metadata_ready_,
130  }
131 
132  static void RecvTrailingMetadataReady(void* arg, grpc_error_handle error) {
133  auto* calld = static_cast<CallData*>(arg);
135  calld->recv_trailing_metadata_->get(GrpcStreamNetworkState());
137  calld->original_recv_trailing_metadata_ready_,
139  }
140 
147  };
148 
150  grpc_channel_element_args* /*args*/) {
151  new (elem->channel_data) TrailingMetadataRecordingFilter();
152  return GRPC_ERROR_NONE;
153  }
154 
155  static void Destroy(grpc_channel_element* elem) {
156  auto* chand =
157  static_cast<TrailingMetadataRecordingFilter*>(elem->channel_data);
158  chand->~TrailingMetadataRecordingFilter();
159  }
160 
161  static bool trailing_metadata_available_;
164 };
165 
167  CallData::StartTransportStreamOpBatch,
168  nullptr,
170  sizeof(CallData),
174  sizeof(TrailingMetadataRecordingFilter),
175  Init,
177  Destroy,
179  "trailing-metadata-recording-filter",
180 };
184 
185 class StreamsNotSeenTest : public ::testing::Test {
186  protected:
187  explicit StreamsNotSeenTest(bool server_allows_streams = true)
188  : server_allows_streams_(server_allows_streams) {
189  // Reset the filter state
190  TrailingMetadataRecordingFilter::reset_state();
192  GRPC_CLOSURE_INIT(&on_read_done_, OnReadDone, this, nullptr);
193  // Start the test tcp server
195  test_tcp_server_init(&server_, OnConnect, this);
197  // Start polling on the test tcp server
198  server_poll_thread_ = absl::make_unique<std::thread>([this]() {
199  while (!shutdown_) {
201  }
202  });
203  // Create the channel
206  grpc_arg client_args[] = {
208  const_cast<char*>(GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA), 0),
210  const_cast<char*>(GRPC_ARG_HTTP2_BDP_PROBE), 0),
212  const_cast<char*>(GRPC_ARG_ENABLE_RETRIES), 0)};
213  grpc_channel_args client_channel_args = {GPR_ARRAY_SIZE(client_args),
214  client_args};
217  creds, &client_channel_args);
219  // Wait for the channel to connect
221  channel_, /*try_to_connect=*/true);
222  while (state != GRPC_CHANNEL_READY) {
225  CQ_EXPECT_COMPLETION(cqv_, Tag(1), true);
226  cq_verify(cqv_, 5);
228  }
229  ExecCtx::Get()->Flush();
230  GPR_ASSERT(
232  }
233 
234  ~StreamsNotSeenTest() override {
237  grpc_event ev;
238  do {
240  nullptr);
241  } while (ev.type != GRPC_QUEUE_SHUTDOWN);
245  tcp_, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Test Shutdown"));
246  ExecCtx::Get()->Flush();
248  absl::Seconds(5)));
250  shutdown_ = true;
251  server_poll_thread_->join();
253  ExecCtx::Get()->Flush();
254  }
255 
256  static void OnConnect(void* arg, grpc_endpoint* tcp,
257  grpc_pollset* /* accepting_pollset */,
258  grpc_tcp_server_acceptor* acceptor) {
259  gpr_free(acceptor);
260  StreamsNotSeenTest* self = static_cast<StreamsNotSeenTest*>(arg);
261  self->tcp_ = tcp;
262  grpc_endpoint_add_to_pollset(tcp, self->server_.pollset[0]);
263  grpc_endpoint_read(tcp, &self->read_buffer_, &self->on_read_done_, false,
264  /*min_progress_size=*/1);
265  std::thread([self]() {
266  ExecCtx exec_ctx;
267  // Send settings frame from server
268  if (self->server_allows_streams_) {
269  constexpr char kHttp2SettingsFrame[] =
270  "\x00\x00\x00\x04\x00\x00\x00\x00\x00";
271  self->Write(absl::string_view(kHttp2SettingsFrame,
272  sizeof(kHttp2SettingsFrame) - 1));
273  } else {
274  // Create a settings frame with a max concurrent stream setting of 0
275  constexpr char kHttp2SettingsFrame[] =
276  "\x00\x00\x06\x04\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00";
277  self->Write(absl::string_view(kHttp2SettingsFrame,
278  sizeof(kHttp2SettingsFrame) - 1));
279  }
280  self->connect_notification_.Notify();
281  }).detach();
282  }
283 
284  // This is a blocking call. It waits for the write callback to be invoked
285  // before returning. (In other words, do not call this from a thread that
286  // should not be blocked, for example, a polling thread.)
288  grpc_slice slice =
293  WriteBuffer(&buffer);
295  }
296 
297  void SendPing() {
298  // Send and recv ping ack
299  const char ping_bytes[] =
300  "\x00\x00\x08\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
301  const char ping_ack_bytes[] =
302  "\x00\x00\x08\x06\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
303  Write(absl::string_view(ping_bytes, sizeof(ping_bytes) - 1));
304  WaitForReadBytes(
305  absl::string_view(ping_ack_bytes, sizeof(ping_ack_bytes) - 1));
306  }
307 
308  void SendGoaway(uint32_t last_stream_id) {
311  grpc_chttp2_goaway_append(last_stream_id, 0, grpc_empty_slice(), &buffer);
312  WriteBuffer(&buffer);
314  }
315 
316  void WriteBuffer(grpc_slice_buffer* buffer) {
317  absl::Notification on_write_done_notification_;
318  GRPC_CLOSURE_INIT(&on_write_done_, OnWriteDone,
319  &on_write_done_notification_, nullptr);
321  /*max_frame_size=*/INT_MAX);
322  ExecCtx::Get()->Flush();
323  GPR_ASSERT(on_write_done_notification_.WaitForNotificationWithTimeout(
324  absl::Seconds(5)));
325  }
326 
327  static void OnWriteDone(void* arg, grpc_error_handle error) {
329  absl::Notification* on_write_done_notification_ =
330  static_cast<absl::Notification*>(arg);
331  on_write_done_notification_->Notify();
332  }
333 
334  static void OnReadDone(void* arg, grpc_error_handle error) {
335  StreamsNotSeenTest* self = static_cast<StreamsNotSeenTest*>(arg);
336  if (GRPC_ERROR_IS_NONE(error)) {
337  {
338  MutexLock lock(&self->mu_);
339  for (size_t i = 0; i < self->read_buffer_.count; ++i) {
340  absl::StrAppend(&self->read_bytes_,
341  StringViewFromSlice(self->read_buffer_.slices[i]));
342  }
343  self->read_cv_.SignalAll();
344  }
345  grpc_slice_buffer_reset_and_unref(&self->read_buffer_);
346  grpc_endpoint_read(self->tcp_, &self->read_buffer_, &self->on_read_done_,
347  false, /*min_progress_size=*/1);
348  } else {
349  grpc_slice_buffer_destroy(&self->read_buffer_);
350  self->read_end_notification_.Notify();
351  }
352  }
353 
354  // Waits for \a bytes to show up in read_bytes_
355  void WaitForReadBytes(absl::string_view bytes) {
356  std::atomic<bool> done{false};
357  std::thread cq_driver([&]() {
358  while (!done) {
362  }
363  });
364  {
365  MutexLock lock(&mu_);
366  while (!absl::StrContains(read_bytes_, bytes)) {
367  read_cv_.WaitWithTimeout(&mu_, absl::Seconds(5));
368  }
369  }
370  done = true;
371  cq_driver.join();
372  }
373 
374  // Flag to check whether the server's MAX_CONCURRENT_STREAM setting is
375  // non-zero or not.
377  int port_;
379  std::unique_ptr<std::thread> server_poll_thread_;
380  grpc_endpoint* tcp_ = nullptr;
386  std::string read_bytes_ ABSL_GUARDED_BY(mu_);
387  grpc_channel* channel_ = nullptr;
389  cq_verifier* cqv_ = nullptr;
391  CondVar read_cv_;
392  std::atomic<bool> shutdown_{false};
393 };
394 
395 // Client's HTTP2 transport starts a new stream, sends the request on the wire,
396 // but receives a GOAWAY with a stream ID of 0, meaning that the request was
397 // unseen by the server.The test verifies that the HTTP2 transport adds
398 // GrpcNetworkStreamState with a value of kNotSeenByServer to the trailing
399 // metadata.
400 TEST_F(StreamsNotSeenTest, StartStreamBeforeGoaway) {
401  grpc_call* c =
403  grpc_slice_from_static_string("/foo"), nullptr,
405  GPR_ASSERT(c);
410  grpc_op* op;
411  grpc_op ops[6];
413  const char* error_string;
416  // Send the request
417  memset(ops, 0, sizeof(ops));
418  op = ops;
421  op->flags = 0;
422  op->reserved = nullptr;
423  op++;
425  op->flags = 0;
426  op->reserved = nullptr;
427  op++;
428  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(101),
429  nullptr);
430  CQ_EXPECT_COMPLETION(cqv_, Tag(101), 1);
431  cq_verify(cqv_);
432  // Send a goaway from server signalling that the request was unseen by the
433  // server.
434  SendGoaway(0);
435  memset(ops, 0, sizeof(ops));
436  op = ops;
439  op->flags = 0;
440  op->reserved = nullptr;
441  op++;
446  op->data.recv_status_on_client.error_string = &error_string;
447  op->flags = 0;
448  op->reserved = nullptr;
449  op++;
450  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(102),
451  nullptr);
453  CQ_EXPECT_COMPLETION(cqv_, Tag(102), 1);
454  cq_verify(cqv_);
455  // Verify status and metadata
457  ASSERT_TRUE(TrailingMetadataRecordingFilter::trailing_metadata_available());
458  ASSERT_TRUE(
459  TrailingMetadataRecordingFilter::stream_network_state().has_value());
460  EXPECT_EQ(TrailingMetadataRecordingFilter::stream_network_state().value(),
463  gpr_free(const_cast<char*>(error_string));
466  grpc_call_unref(c);
467  ExecCtx::Get()->Flush();
468 }
469 
470 // Client's HTTP2 transport starts a new stream, sends the request on the wire,
471 // notices that the transport is destroyed. The test verifies that the HTTP2
472 // transport does not add GrpcNetworkStreamState metadata since we don't know
473 // whether the server saw the request or not.
474 TEST_F(StreamsNotSeenTest, TransportDestroyed) {
475  grpc_call* c =
477  grpc_slice_from_static_string("/foo"), nullptr,
479  GPR_ASSERT(c);
484  grpc_op* op;
485  grpc_op ops[6];
487  const char* error_string;
490  // Send the request
491  memset(ops, 0, sizeof(ops));
492  op = ops;
495  op->flags = 0;
496  op->reserved = nullptr;
497  op++;
499  op->flags = 0;
500  op->reserved = nullptr;
501  op++;
502  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(101),
503  nullptr);
504  CQ_EXPECT_COMPLETION(cqv_, Tag(101), 1);
505  cq_verify(cqv_);
506  // Shutdown the server endpoint
508  tcp_, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown"));
509  memset(ops, 0, sizeof(ops));
510  op = ops;
513  op->flags = 0;
514  op->reserved = nullptr;
515  op++;
520  op->data.recv_status_on_client.error_string = &error_string;
521  op->flags = 0;
522  op->reserved = nullptr;
523  op++;
524  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(102),
525  nullptr);
527  CQ_EXPECT_COMPLETION(cqv_, Tag(102), 1);
528  cq_verify(cqv_);
529  // Verify status and metadata
531  EXPECT_FALSE(
532  TrailingMetadataRecordingFilter::stream_network_state().has_value());
534  gpr_free(const_cast<char*>(error_string));
537  grpc_call_unref(c);
538  ExecCtx::Get()->Flush();
539 }
540 
541 // Client's HTTP2 transport tries to send an RPC after having received a GOAWAY
542 // frame. The test verifies that the HTTP2 transport adds GrpcNetworkStreamState
543 // with a value of kNotSentOnWire to the trailing metadata.
544 TEST_F(StreamsNotSeenTest, StartStreamAfterGoaway) {
545  // Send Goaway from the server
546  SendGoaway(0);
547  // Send a ping to make sure that the goaway was received.
548  SendPing();
549  // Try sending an RPC
550  grpc_call* c =
552  grpc_slice_from_static_string("/foo"), nullptr,
554  GPR_ASSERT(c);
559  grpc_op* op;
560  grpc_op ops[6];
562  const char* error_string;
565  memset(ops, 0, sizeof(ops));
566  op = ops;
569  op->flags = 0;
570  op->reserved = nullptr;
571  op++;
573  op->flags = 0;
574  op->reserved = nullptr;
575  op++;
578  op->flags = 0;
579  op->reserved = nullptr;
580  op++;
585  op->data.recv_status_on_client.error_string = &error_string;
586  op->flags = 0;
587  op->reserved = nullptr;
588  op++;
589  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(101),
590  nullptr);
592  CQ_EXPECT_COMPLETION(cqv_, Tag(101), 1);
593  cq_verify(cqv_);
594  // Verify status and metadata
596  ASSERT_TRUE(TrailingMetadataRecordingFilter::trailing_metadata_available());
597  ASSERT_TRUE(
598  TrailingMetadataRecordingFilter::stream_network_state().has_value());
599  EXPECT_EQ(TrailingMetadataRecordingFilter::stream_network_state().value(),
602  gpr_free(const_cast<char*>(error_string));
605  grpc_call_unref(c);
606  ExecCtx::Get()->Flush();
607 }
608 
609 // These tests have the server sending a SETTINGS_FRAME with a max concurrent
610 // streams settings of 0 which denies the client the chance to start a stream.
611 // Note that in the future, these tests might become outdated if the
612 // client_channel learns about the max concurrent streams setting.
613 class ZeroConcurrencyTest : public StreamsNotSeenTest {
614  protected:
615  ZeroConcurrencyTest() : StreamsNotSeenTest(/*server_allows_streams=*/false) {}
616 };
617 
618 // Client's HTTP2 transport receives a RPC request, but it cannot start the RPC
619 // because of the max concurrent streams setting. A goaway frame is then
620 // received which should result in the RPC getting cancelled with
621 // kNotSentOnWire.
622 TEST_F(ZeroConcurrencyTest, StartStreamBeforeGoaway) {
623  grpc_call* c =
625  grpc_slice_from_static_string("/foo"), nullptr,
627  GPR_ASSERT(c);
632  grpc_op* op;
633  grpc_op ops[6];
635  const char* error_string;
638  // Send the request
639  memset(ops, 0, sizeof(ops));
640  op = ops;
643  op->flags = 0;
644  op->reserved = nullptr;
645  op++;
647  op->flags = 0;
648  op->reserved = nullptr;
649  op++;
652  op->flags = 0;
653  op->reserved = nullptr;
654  op++;
659  op->data.recv_status_on_client.error_string = &error_string;
660  op->flags = 0;
661  op->reserved = nullptr;
662  op++;
663  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(101),
664  nullptr);
665  // This test assumes that nothing would pause the RPC before its received by
666  // the transport. If that no longer holds true, we might need to drive the cq
667  // for some time to make sure that the RPC reaches the HTTP2 layer.
668  SendGoaway(0);
670  CQ_EXPECT_COMPLETION(cqv_, Tag(101), 1);
671  cq_verify(cqv_);
672  // Verify status and metadata
674  ASSERT_TRUE(TrailingMetadataRecordingFilter::trailing_metadata_available());
675  ASSERT_TRUE(
676  TrailingMetadataRecordingFilter::stream_network_state().has_value());
677  EXPECT_EQ(TrailingMetadataRecordingFilter::stream_network_state().value(),
680  gpr_free(const_cast<char*>(error_string));
683  grpc_call_unref(c);
684  ExecCtx::Get()->Flush();
685 }
686 
687 // Client's HTTP2 transport receives a RPC request, but it cannot start the RPC
688 // because of the max concurrent streams setting. Server then shuts its endpoint
689 // which should result in the RPC getting cancelled with kNotSentOnWire.
690 TEST_F(ZeroConcurrencyTest, TransportDestroyed) {
691  grpc_call* c =
693  grpc_slice_from_static_string("/foo"), nullptr,
695  GPR_ASSERT(c);
700  grpc_op* op;
701  grpc_op ops[6];
703  const char* error_string;
706  // Send the request
707  memset(ops, 0, sizeof(ops));
708  op = ops;
711  op->flags = 0;
712  op->reserved = nullptr;
713  op++;
715  op->flags = 0;
716  op->reserved = nullptr;
717  op++;
720  op->flags = 0;
721  op->reserved = nullptr;
722  op++;
727  op->data.recv_status_on_client.error_string = &error_string;
728  op->flags = 0;
729  op->reserved = nullptr;
730  op++;
731  error = grpc_call_start_batch(c, ops, static_cast<size_t>(op - ops), Tag(101),
732  nullptr);
734  tcp_, GRPC_ERROR_CREATE_FROM_STATIC_STRING("Server shutdown"));
736  CQ_EXPECT_COMPLETION(cqv_, Tag(101), 1);
737  cq_verify(cqv_);
738  // Verify status and metadata
740  ASSERT_TRUE(TrailingMetadataRecordingFilter::trailing_metadata_available());
741  ASSERT_TRUE(
742  TrailingMetadataRecordingFilter::stream_network_state().has_value());
743  EXPECT_EQ(TrailingMetadataRecordingFilter::stream_network_state().value(),
746  gpr_free(const_cast<char*>(error_string));
749  grpc_call_unref(c);
750  ExecCtx::Get()->Flush();
751 }
752 
753 } // namespace
754 } // namespace grpc_core
755 
756 int main(int argc, char** argv) {
757  ::testing::InitGoogleTest(&argc, argv);
758  grpc::testing::TestEnvironment env(&argc, argv);
759  int result;
763  auto register_stage = [builder](grpc_channel_stack_type type,
764  const grpc_channel_filter* filter) {
765  builder->channel_init()->RegisterStage(
766  type, INT_MAX, [filter](grpc_core::ChannelStackBuilder* builder) {
767  // Want to add the filter as close to the end as possible, to
768  // make sure that all of the filters work well together.
769  // However, we can't add it at the very end, because the
770  // connected channel filter must be the last one. So we add it
771  // right before the last one.
772  auto it = builder->mutable_stack()->end();
773  --it;
774  builder->mutable_stack()->insert(it, filter);
775  return true;
776  });
777  };
778  register_stage(
781  },
782  [&] {
785  true);
786  grpc_init();
787  {
789  result = RUN_ALL_TESTS();
790  }
791  grpc_shutdown();
792  });
793  return result;
794 }
GRPC_CLOSURE_INIT
#define GRPC_CLOSURE_INIT(closure, cb, cb_arg, scheduler)
Definition: closure.h:115
grpc_arg
Definition: grpc_types.h:103
recv_initial_metadata_ready_
grpc_closure recv_initial_metadata_ready_
Definition: streams_not_seen_test.cc:142
EXPECT_FALSE
#define EXPECT_FALSE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1970
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
slice.h
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
read_buffer_
grpc_slice_buffer read_buffer_
Definition: streams_not_seen_test.cc:382
grpc_op::flags
uint32_t flags
Definition: grpc_types.h:644
test_tcp_server_init
void test_tcp_server_init(test_tcp_server *server, grpc_tcp_server_cb on_connect, void *user_data)
Definition: test_tcp_server.cc:43
grpc_call_error
grpc_call_error
Definition: grpc_types.h:464
grpc_core::slice_detail::BaseSlice::TakeCSlice
grpc_slice TakeCSlice()
Definition: src/core/lib/slice/slice.h:82
grpc_slice_buffer_destroy
GPRAPI void grpc_slice_buffer_destroy(grpc_slice_buffer *sb)
Definition: slice_buffer_api.cc:27
GRPC_CHANNEL_READY
@ GRPC_CHANNEL_READY
Definition: include/grpc/impl/codegen/connectivity_state.h:36
regen-readme.it
it
Definition: regen-readme.py:15
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::trailing_metadata
grpc_metadata_array * trailing_metadata
Definition: grpc_types.h:701
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
grpc_timeout_seconds_to_deadline
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
Definition: test/core/util/test_config.cc:81
port.h
core_configuration.h
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::status
grpc_status_code * status
Definition: grpc_types.h:702
GRPC_STATUS_UNAVAILABLE
@ GRPC_STATUS_UNAVAILABLE
Definition: include/grpc/impl/codegen/status.h:143
server_poll_thread_
std::unique_ptr< std::thread > server_poll_thread_
Definition: streams_not_seen_test.cc:379
MutexLock
#define MutexLock(x)
Definition: bloaty/third_party/re2/util/mutex.h:125
test_tcp_server_start
void test_tcp_server_start(test_tcp_server *server, int port)
Definition: test_tcp_server.cc:57
absl::StrAppend
void StrAppend(std::string *dest, const AlphaNum &a)
Definition: abseil-cpp/absl/strings/str_cat.cc:193
generate.env
env
Definition: generate.py:37
memset
return memset(p, 0, total)
fix_build_deps.c
list c
Definition: fix_build_deps.py:490
grpc_op::grpc_op_data::send_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_send_initial_metadata send_initial_metadata
false
#define false
Definition: setup_once.h:323
grpc_channel_next_op
void grpc_channel_next_op(grpc_channel_element *elem, grpc_transport_op *op)
Definition: channel_stack.cc:264
grpc_core
Definition: call_metric_recorder.h:31
grpc_metadata_array
Definition: grpc_types.h:579
grpc_core::CoreConfiguration::Builder
Definition: core_configuration.h:41
main
int main(int argc, char **argv)
Definition: streams_not_seen_test.cc:756
mu_
Mutex mu_
Definition: streams_not_seen_test.cc:390
grpc_op::reserved
void * reserved
Definition: grpc_types.h:646
string.h
grpc_channel_check_connectivity_state
GRPCAPI grpc_connectivity_state grpc_channel_check_connectivity_state(grpc_channel *channel, int try_to_connect)
Definition: channel_connectivity.cc:56
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_core::StringViewFromSlice
absl::string_view StringViewFromSlice(const grpc_slice &slice)
Definition: slice_internal.h:93
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
grpc_endpoint_read
void grpc_endpoint_read(grpc_endpoint *ep, grpc_slice_buffer *slices, grpc_closure *cb, bool urgent, int min_progress_size)
Definition: endpoint.cc:25
grpc_channel_element
Definition: channel_stack.h:186
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
elem
Timer elem
Definition: event_engine/iomgr_event_engine/timer_heap_test.cc:109
error
grpc_error_handle error
Definition: retry_filter.cc:499
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
tcp
static uv_tcp_t tcp
Definition: test-connection-fail.c:29
GRPC_CALL_OK
@ GRPC_CALL_OK
Definition: grpc_types.h:466
ABSL_GUARDED_BY
#define ABSL_GUARDED_BY(x)
Definition: abseil-cpp/absl/base/thread_annotations.h:62
status
absl::Status status
Definition: rls.cc:251
google::protobuf::python::cmessage::Init
static int Init(CMessage *self, PyObject *args, PyObject *kwargs)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:1287
kFilterVtable
static grpc_channel_filter kFilterVtable
Definition: streams_not_seen_test.cc:54
grpc_call_stack_ignore_set_pollset_or_pollset_set
void grpc_call_stack_ignore_set_pollset_or_pollset_set(grpc_call_element *, grpc_polling_entity *)
Definition: channel_stack.cc:233
GRPC_CLIENT_SUBCHANNEL
@ GRPC_CLIENT_SUBCHANNEL
Definition: channel_stack_type.h:29
grpc_security.h
grpc_call_element
Definition: channel_stack.h:194
test_tcp_server
Definition: test_tcp_server.h:30
grpc_channel_args
Definition: grpc_types.h:132
testing::Test
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:402
grpc_connectivity_state
grpc_connectivity_state
Definition: include/grpc/impl/codegen/connectivity_state.h:30
grpc_core::ChannelStackBuilder
Definition: channel_stack_builder.h:41
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
test_tcp_server_destroy
void test_tcp_server_destroy(test_tcp_server *server)
Definition: test_tcp_server.cc:103
absl::Notification
Definition: abseil-cpp/absl/synchronization/notification.h:66
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
grpc_metadata_array_destroy
GRPCAPI void grpc_metadata_array_destroy(grpc_metadata_array *array)
Definition: metadata_array.cc:35
on_write_done_
grpc_closure on_write_done_
Definition: streams_not_seen_test.cc:383
GRPC_ARG_ENABLE_RETRIES
#define GRPC_ARG_ENABLE_RETRIES
Definition: grpc_types.h:396
DEBUG_LOCATION
#define DEBUG_LOCATION
Definition: debug_location.h:41
trailing_metadata_recv
static grpc_metadata_array trailing_metadata_recv
Definition: test/core/fling/client.cc:43
test_tcp_server.h
grpc_chttp2_goaway_append
void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code, const grpc_slice &debug_data, grpc_slice_buffer *slice_buffer)
Definition: frame_goaway.cc:155
profile_analyzer.builder
builder
Definition: profile_analyzer.py:159
cq_
grpc_completion_queue * cq_
Definition: streams_not_seen_test.cc:388
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
GRPC_OP_RECV_INITIAL_METADATA
@ GRPC_OP_RECV_INITIAL_METADATA
Definition: grpc_types.h:617
recv_trailing_metadata_ready_
grpc_closure recv_trailing_metadata_ready_
Definition: streams_not_seen_test.cc:145
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
original_recv_trailing_metadata_ready_
grpc_closure * original_recv_trailing_metadata_ready_
Definition: streams_not_seen_test.cc:146
gen_stats_data.c_str
def c_str(s, encoding='ascii')
Definition: gen_stats_data.py:38
grpc_core::ExecCtx::Flush
bool Flush()
Definition: exec_ctx.cc:69
grpc_channel_stack_no_post_init
void grpc_channel_stack_no_post_init(grpc_channel_stack *, grpc_channel_element *)
Definition: channel_stack.cc:282
grpc_call_unref
GRPCAPI void grpc_call_unref(grpc_call *call)
Definition: call.cc:1770
grpc_op::grpc_op_data::grpc_op_recv_status_on_client::error_string
const char ** error_string
Definition: grpc_types.h:707
grpc_timeout_milliseconds_to_deadline
gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms)
Definition: test/core/util/test_config.cc:89
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
connect_notification_
absl::Notification connect_notification_
Definition: streams_not_seen_test.cc:381
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
cqv_
cq_verifier * cqv_
Definition: streams_not_seen_test.cc:389
grpc_slice_buffer_reset_and_unref
GPRAPI void grpc_slice_buffer_reset_and_unref(grpc_slice_buffer *sb)
Definition: slice_buffer_api.cc:32
grpc.h
grpc_call
struct grpc_call grpc_call
Definition: grpc_types.h:70
absl::Notification::Notify
void Notify()
Definition: abseil-cpp/absl/synchronization/notification.cc:27
grpc_core::JoinHostPort
std::string JoinHostPort(absl::string_view host, int port)
Definition: host_port.cc:32
grpc_channel_next_get_info
void grpc_channel_next_get_info(grpc_channel_element *elem, const grpc_channel_info *channel_info)
Definition: channel_stack.cc:258
opencensus.proto.stats.v1.stats_pb2.Tag
Tag
Definition: stats_pb2.py:431
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
frame_goaway.h
done
struct tab * done
Definition: bloaty/third_party/zlib/examples/enough.c:176
grpc_op
Definition: grpc_types.h:640
test_tcp_server_poll
void test_tcp_server_poll(test_tcp_server *server, int milliseconds)
Definition: test_tcp_server.cc:87
arg
Definition: cmdline.cc:40
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_transport_stream_op_batch::payload
grpc_transport_stream_op_batch_payload * payload
Definition: transport.h:307
grpc_core::TEST_F
TEST_F(AuthorizationMatchersTest, AlwaysAuthorizationMatcher)
Definition: authorization_matchers_test.cc:35
grpc_empty_slice
GPRAPI grpc_slice grpc_empty_slice(void)
Definition: slice/slice.cc:42
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
absl::StrContains
ABSL_NAMESPACE_BEGIN bool StrContains(absl::string_view haystack, absl::string_view needle) noexcept
Definition: third_party/abseil-cpp/absl/strings/match.h:46
stream_network_state_
static absl::optional< GrpcStreamNetworkState::ValueType > stream_network_state_
Definition: streams_not_seen_test.cc:163
recv_trailing_metadata_
grpc_metadata_batch * recv_trailing_metadata_
Definition: streams_not_seen_test.cc:144
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA
#define GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA
Definition: grpc_types.h:226
cq_verifier
Definition: cq_verifier.cc:76
grpc_core::TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification
void TestOnlyGlobalHttp2TransportDisableTransientFailureStateNotification(bool disable)
Definition: chttp2_transport.cc:222
server_
test_tcp_server server_
Definition: streams_not_seen_test.cc:378
grpc_endpoint_shutdown
void grpc_endpoint_shutdown(grpc_endpoint *ep, grpc_error_handle why)
Definition: endpoint.cc:49
grpc_call_next_op
void grpc_call_next_op(grpc_call_element *elem, grpc_transport_stream_op_batch *op)
Definition: channel_stack.cc:251
host_port.h
grpc_call_element_args
Definition: channel_stack.h:80
batch
grpc_transport_stream_op_batch * batch
Definition: retry_filter.cc:243
CQ_EXPECT_COMPLETION
#define CQ_EXPECT_COMPLETION(v, tag, success)
Definition: cq_verifier.h:58
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
RUN_ALL_TESTS
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:2471
grpc_pick_unused_port_or_die
int grpc_pick_unused_port_or_die(void)
grpc_endpoint_destroy
void grpc_endpoint_destroy(grpc_endpoint *ep)
Definition: endpoint.cc:53
grpc_core::ExecCtx
Definition: exec_ctx.h:97
grpc_core::GrpcStreamNetworkState::kNotSentOnWire
@ kNotSentOnWire
Definition: metadata_batch.h:369
grpc_slice_buffer_init
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb)
Definition: slice/slice_buffer.cc:116
grpc_channel_filter
Definition: channel_stack.h:111
grpc_op::op
grpc_op_type op
Definition: grpc_types.h:642
GRPC_ERROR_CREATE_FROM_STATIC_STRING
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc)
Definition: error.h:291
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
on_read_done_
grpc_closure on_read_done_
Definition: streams_not_seen_test.cc:384
details
static grpc_slice details
Definition: test/core/fling/client.cc:46
test_config.h
value
const char * value
Definition: hpack_parser_table.cc:165
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_transport_stream_op_batch::recv_initial_metadata
bool recv_initial_metadata
Definition: transport.h:319
absl::Seconds
constexpr Duration Seconds(T n)
Definition: third_party/abseil-cpp/absl/time/time.h:419
GPR_ARRAY_SIZE
#define GPR_ARRAY_SIZE(array)
Definition: useful.h:129
grpc_slice_buffer_add
GPRAPI void grpc_slice_buffer_add(grpc_slice_buffer *sb, grpc_slice slice)
Definition: slice/slice_buffer.cc:170
channel_
grpc_channel * channel_
Definition: streams_not_seen_test.cc:387
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_ERROR_REF
#define GRPC_ERROR_REF(err)
Definition: error.h:261
GRPC_PROPAGATE_DEFAULTS
#define GRPC_PROPAGATE_DEFAULTS
Definition: propagation_bits.h:45
phony_transport::Destroy
void Destroy(grpc_transport *)
Definition: bm_call_create.cc:443
testing::internal::posix::Write
int Write(int fd, const void *buf, unsigned int count)
Definition: bloaty/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:2047
grpc_core::slice_detail::StaticConstructors< StaticSlice >::FromStaticBuffer
static StaticSlice FromStaticBuffer(const void *s, size_t len)
Definition: src/core/lib/slice/slice.h:209
grpc_channel_arg_integer_create
grpc_arg grpc_channel_arg_integer_create(char *name, int value)
Definition: channel_args.cc:484
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
cq_verifier.h
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
grpc_tcp_server_acceptor
Definition: tcp_server.h:36
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
absl::str_format_internal::LengthMod::t
@ t
grpc_core::BuildCoreConfiguration
void BuildCoreConfiguration(CoreConfiguration::Builder *builder)
Definition: grpc_plugin_registry.cc:109
google::protobuf.internal::Mutex
WrappedMutex Mutex
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/mutex.h:113
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::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
chttp2_transport.h
grpc_transport_stream_op_batch_payload::recv_initial_metadata
grpc_metadata_batch * recv_initial_metadata
Definition: transport.h:390
GRPC_ARG_HTTP2_BDP_PROBE
#define GRPC_ARG_HTTP2_BDP_PROBE
Definition: grpc_types.h:204
grpc_channel_stack_type
grpc_channel_stack_type
Definition: channel_stack_type.h:24
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
ASSERT_TRUE
#define ASSERT_TRUE(condition)
Definition: bloaty/third_party/googletest/googletest/include/gtest/gtest.h:1973
grpc_completion_queue_shutdown
GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
Definition: completion_queue.cc:1416
arg
struct arg arg
grpc_channel_destroy
GRPCAPI void grpc_channel_destroy(grpc_channel *channel)
Definition: channel.cc:437
state
Definition: bloaty/third_party/zlib/contrib/blast/blast.c:41
grpc_core::CoreConfiguration::RunWithSpecialConfiguration
static void RunWithSpecialConfiguration(BuildFunc build_configuration, RunFunc code_to_run)
Definition: core_configuration.h:129
grpc_channel
struct grpc_channel grpc_channel
Definition: grpc_types.h:62
server_allows_streams_
bool server_allows_streams_
Definition: streams_not_seen_test.cc:376
grpc_channel_watch_connectivity_state
GRPCAPI void grpc_channel_watch_connectivity_state(grpc_channel *channel, grpc_connectivity_state last_observed_state, gpr_timespec deadline, grpc_completion_queue *cq, void *tag)
Definition: channel_connectivity.cc:227
grpc_transport_stream_op_batch::recv_trailing_metadata
bool recv_trailing_metadata
Definition: transport.h:326
grpc_endpoint_write
void grpc_endpoint_write(grpc_endpoint *ep, grpc_slice_buffer *slices, grpc_closure *cb, void *arg, int max_frame_size)
Definition: endpoint.cc:30
read_end_notification_
absl::Notification read_end_notification_
Definition: streams_not_seen_test.cc:385
grpc_core::GrpcStreamNetworkState::kNotSeenByServer
@ kNotSeenByServer
Definition: metadata_batch.h:370
absl::Notification::WaitForNotificationWithTimeout
bool WaitForNotificationWithTimeout(absl::Duration timeout) const
Definition: abseil-cpp/absl/synchronization/notification.cc:56
grpc_channel_element_args
Definition: channel_stack.h:74
read_cv_
CondVar read_cv_
Definition: streams_not_seen_test.cc:391
grpc_slice_buffer
Definition: include/grpc/impl/codegen/slice.h:83
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_op::grpc_op_data::recv_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_recv_initial_metadata recv_initial_metadata
grpc_call_final_info
Definition: channel_stack.h:95
grpc_transport_stream_op_batch_payload::recv_trailing_metadata
grpc_metadata_batch * recv_trailing_metadata
Definition: transport.h:425
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
grpc_event::type
grpc_completion_type type
Definition: grpc_types.h:566
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
grpc_error
Definition: error_internal.h:42
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
self
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/map.c:543
shutdown_
std::atomic< bool > shutdown_
Definition: streams_not_seen_test.cc:392
grpc_endpoint_add_to_pollset
void grpc_endpoint_add_to_pollset(grpc_endpoint *ep, grpc_pollset *pollset)
Definition: endpoint.cc:35
port_
int port_
Definition: streams_not_seen_test.cc:377
grpc_metadata_batch
Definition: metadata_batch.h:1259
grpc_pollset
Definition: bm_cq_multiple_threads.cc:37
channel_stack_builder.h
grpc_transport_stream_op_batch
Definition: transport.h:284
grpc_closure
Definition: closure.h:56
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
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_QUEUE_TIMEOUT
@ GRPC_QUEUE_TIMEOUT
Definition: grpc_types.h:556
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_endpoint
Definition: endpoint.h:105
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_channel_credentials
Definition: src/core/lib/security/credentials/credentials.h:96
grpc_core::Closure::Run
static void Run(const DebugLocation &location, grpc_closure *closure, grpc_error_handle error)
Definition: closure.h:250
thread
static uv_thread_t thread
Definition: test-async-null-cb.c:29
grpc_core::ExecCtx::Get
static ExecCtx * Get()
Definition: exec_ctx.h:205
GRPC_OP_SEND_CLOSE_FROM_CLIENT
@ GRPC_OP_SEND_CLOSE_FROM_CLIENT
Definition: grpc_types.h:607
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
grpc_metadata_array_init
GRPCAPI void grpc_metadata_array_init(grpc_metadata_array *array)
Definition: metadata_array.cc:30
trailing_metadata_available_
bool * trailing_metadata_available_
Definition: streams_not_seen_test.cc:141
tcp_
grpc_endpoint * tcp_
Definition: streams_not_seen_test.cc:380
GRPC_ERROR_IS_NONE
#define GRPC_ERROR_IS_NONE(err)
Definition: error.h:241
original_recv_initial_metadata_ready_
grpc_closure * original_recv_initial_metadata_ready_
Definition: streams_not_seen_test.cc:143
channel.h
port_platform.h


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