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",
"if",
"inter_activity_pipe",
"latent_see",
"loop",
"map",
"memory_quota",

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

@ -50,6 +50,9 @@
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/server/server_interface.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 {
@ -193,13 +196,18 @@ void ServerCall::CommitBatch(const grpc_op* ops, size_t nops, void* notify_tag,
});
});
call_handler_.SpawnInfallible(
"final-batch", InfallibleBatch(std::move(primary_ops),
std::move(recv_trailing_metadata),
is_notify_tag_closure, notify_tag, cq_));
"final-batch",
GRPC_LATENT_SEE_PROMISE(
"ServerCallBatch",
InfallibleBatch(std::move(primary_ops),
std::move(recv_trailing_metadata),
is_notify_tag_closure, notify_tag, cq_)));
} else {
call_handler_.SpawnInfallible(
"batch", FallibleBatch(std::move(primary_ops), is_notify_tag_closure,
notify_tag, cq_));
"batch", GRPC_LATENT_SEE_PROMISE(
"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
// undefined behavior.
auto Write(SliceBuffer data) {
GRPC_LATENT_SEE_PARENT_SCOPE("GRPC:Write");
// Start write and assert previous write finishes.
auto prev = write_state_->state.exchange(WriteState::kWriting,
std::memory_order_relaxed);
@ -132,6 +133,7 @@ class PromiseEndpoint {
// `Read()` before the previous read finishes. Doing that results in
// undefined behavior.
auto Read(size_t num_bytes) {
GRPC_LATENT_SEE_PARENT_SCOPE("GRPC:Read");
// Assert previous read finishes.
CHECK(!read_state_->complete.load(std::memory_order_relaxed));
// Should not have pending reads.

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

Loading…
Cancel
Save