Skip to content

Commit

Permalink
[promises] Log errors in TrySeq (grpc#35319)
Browse files Browse the repository at this point in the history
When an error occurs in `TrySeq`, log the error.
Also, in the trace statements, capture the file/line that the sequence was constructed at, and log that with the traces.

Closes grpc#35319

COPYBARA_INTEGRATE_REVIEW=grpc#35319 from ctiller:trace-seq bc0d473
PiperOrigin-RevId: 591999228
  • Loading branch information
ctiller authored and copybara-github committed Dec 18, 2023
1 parent b589b10 commit 6d35000
Show file tree
Hide file tree
Showing 7 changed files with 584 additions and 171 deletions.
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2511,6 +2511,7 @@ grpc_cc_library(
language = "c++",
public_hdrs = ["//src/core:lib/gprpp/debug_location.h"],
visibility = ["@grpc:debug_location"],
deps = ["gpr_platform"],
)

grpc_cc_library(
Expand Down
8 changes: 7 additions & 1 deletion src/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,10 @@ grpc_cc_library(

grpc_cc_library(
name = "seq_state",
external_deps = ["absl/base:core_headers"],
external_deps = [
"absl/base:core_headers",
"absl/strings",
],
language = "c++",
public_hdrs = [
"lib/promise/detail/seq_state.h",
Expand All @@ -765,6 +768,7 @@ grpc_cc_library(
"promise_factory",
"promise_like",
"promise_trace",
"//:debug_location",
"//:gpr",
],
)
Expand All @@ -780,6 +784,7 @@ grpc_cc_library(
"poll",
"promise_like",
"seq_state",
"//:debug_location",
"//:gpr_platform",
],
)
Expand All @@ -801,6 +806,7 @@ grpc_cc_library(
"promise_like",
"promise_status",
"seq_state",
"//:debug_location",
"//:gpr_platform",
],
)
Expand Down
4 changes: 4 additions & 0 deletions src/core/lib/gprpp/debug_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef GRPC_SRC_CORE_LIB_GPRPP_DEBUG_LOCATION_H
#define GRPC_SRC_CORE_LIB_GPRPP_DEBUG_LOCATION_H

#include <grpc/support/port_platform.h>

#include <utility>

#if defined(__has_builtin)
#if __has_builtin(__builtin_FILE)
#define GRPC_DEFAULT_FILE __builtin_FILE()
Expand Down
Loading

0 comments on commit 6d35000

Please sign in to comment.