Add latent see annotations to more of grpc

PiperOrigin-RevId: 691669259
pull/38007/head
Craig Tiller 4 months ago committed by Copybara-Service
parent 99f6ee2553
commit ca1b57c340
  1. 1
      src/core/BUILD
  2. 8
      src/core/lib/surface/client_call.cc
  3. 18
      src/core/lib/surface/server_call.cc
  4. 2
      src/core/lib/transport/promise_endpoint.h
  5. 1
      src/core/server/server.cc

@ -8047,6 +8047,7 @@ grpc_cc_library(
"grpc_promise_endpoint", "grpc_promise_endpoint",
"if", "if",
"inter_activity_pipe", "inter_activity_pipe",
"latent_see",
"loop", "loop",
"map", "map",
"memory_quota", "memory_quota",

@ -192,7 +192,9 @@ void ClientCall::ScheduleCommittedBatch(Batch batch) {
auto pending = std::make_unique<UnorderedStart>(); auto pending = std::make_unique<UnorderedStart>();
pending->start_pending_batch = [this, pending->start_pending_batch = [this,
batch = std::move(batch)]() mutable { batch = std::move(batch)]() mutable {
started_call_initiator_.SpawnInfallible("batch", std::move(batch)); started_call_initiator_.SpawnInfallible(
"batch",
GRPC_LATENT_SEE_PROMISE("ClientCallBatch", std::move(batch)));
}; };
while (true) { while (true) {
pending->next = reinterpret_cast<UnorderedStart*>(cur_state); pending->next = reinterpret_cast<UnorderedStart*>(cur_state);
@ -212,7 +214,9 @@ void ClientCall::ScheduleCommittedBatch(Batch batch) {
} }
} }
case kStarted: case kStarted:
started_call_initiator_.SpawnInfallible("batch", std::move(batch)); started_call_initiator_.SpawnInfallible(
"batch",
GRPC_LATENT_SEE_PROMISE("ClientCallBatch", std::move(batch)));
return; return;
case kCancelled: case kCancelled:
return; return;

@ -50,6 +50,9 @@
#include "src/core/lib/transport/metadata_batch.h" #include "src/core/lib/transport/metadata_batch.h"
#include "src/core/server/server_interface.h" #include "src/core/server/server_interface.h"
#include "src/core/util/bitset.h" #include "src/core/util/bitset.h"
#include "absl/log/check.h"
#include "absl/strings/string_view.h"
#include "third_party/grpc/src/core/util/latent_see.h"
namespace grpc_core { namespace grpc_core {
@ -193,13 +196,18 @@ void ServerCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
}); });
}); });
call_handler_.SpawnInfallible( call_handler_.SpawnInfallible(
"final-batch", InfallibleBatch(std::move(primary_ops), "final-batch",
std::move(recv_trailing_metadata), GRPC_LATENT_SEE_PROMISE(
is_notify_tag_closure, notify_tag, cq_)); "ServerCallBatch",
InfallibleBatch(std::move(primary_ops),
std::move(recv_trailing_metadata),
is_notify_tag_closure, notify_tag, cq_)));
} else { } else {
call_handler_.SpawnInfallible( call_handler_.SpawnInfallible(
"batch", FallibleBatch(std::move(primary_ops), is_notify_tag_closure, "batch", GRPC_LATENT_SEE_PROMISE(
notify_tag, cq_)); "ServerCallBatch",
FallibleBatch(std::move(primary_ops),
is_notify_tag_closure, notify_tag, cq_)));
} }
} }

@ -70,6 +70,7 @@ class PromiseEndpoint {
// `Write()` before the previous write finishes. Doing that results in // `Write()` before the previous write finishes. Doing that results in
// undefined behavior. // undefined behavior.
auto Write(SliceBuffer data) { auto Write(SliceBuffer data) {
GRPC_LATENT_SEE_PARENT_SCOPE("GRPC:Write");
// Start write and assert previous write finishes. // Start write and assert previous write finishes.
auto prev = write_state_->state.exchange(WriteState::kWriting, auto prev = write_state_->state.exchange(WriteState::kWriting,
std::memory_order_relaxed); std::memory_order_relaxed);
@ -132,6 +133,7 @@ class PromiseEndpoint {
// `Read()` before the previous read finishes. Doing that results in // `Read()` before the previous read finishes. Doing that results in
// undefined behavior. // undefined behavior.
auto Read(size_t num_bytes) { auto Read(size_t num_bytes) {
GRPC_LATENT_SEE_PARENT_SCOPE("GRPC:Read");
// Assert previous read finishes. // Assert previous read finishes.
CHECK(!read_state_->complete.load(std::memory_order_relaxed)); CHECK(!read_state_->complete.load(std::memory_order_relaxed));
// Should not have pending reads. // Should not have pending reads.

@ -976,6 +976,7 @@ grpc_error_handle Server::SetupTransport(
Transport* transport, grpc_pollset* accepting_pollset, Transport* transport, grpc_pollset* accepting_pollset,
const ChannelArgs& args, const ChannelArgs& args,
const RefCountedPtr<channelz::SocketNode>& socket_node) { const RefCountedPtr<channelz::SocketNode>& socket_node) {
GRPC_LATENT_SEE_INNER_SCOPE("Server::SetupTransport");
// Create channel. // Create channel.
global_stats().IncrementServerChannelsCreated(); global_stats().IncrementServerChannelsCreated();
// Set up channelz node. // Set up channelz node.

Loading…
Cancel
Save