Reland "Enable GRPC_ERROR_IS_ABSEIL_STATUS" (#30047)

* Revert "Revert "Enable GRPC_ERROR_IS_ABSEIL_STATUS (#29869)" (#30031)"

This reverts commit 2d0d1775a9.

* Fix the test
pull/30088/head
Esun Kim 3 years ago committed by GitHub
parent c03388853c
commit c66c362191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      BUILD
  2. 2
      bazel/grpc_build_system.bzl
  3. 7
      include/grpc/impl/codegen/port_platform.h
  4. 2
      src/core/ext/filters/client_channel/backup_poller.cc
  5. 2
      src/core/ext/filters/client_channel/dynamic_filters.cc
  6. 1
      src/core/ext/filters/deadline/deadline_filter.cc
  7. 1
      src/core/ext/filters/http/message_compress/message_compress_filter.cc
  8. 1
      src/core/ext/filters/http/message_compress/message_decompress_filter.cc
  9. 1
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  10. 2
      src/core/ext/transport/chttp2/transport/flow_control.h
  11. 1
      src/core/ext/transport/chttp2/transport/frame_data.cc
  12. 1
      src/core/ext/transport/chttp2/transport/hpack_parser.cc
  13. 1
      src/core/ext/transport/chttp2/transport/parsing.cc
  14. 1
      src/core/ext/transport/cronet/transport/cronet_transport.cc
  15. 1
      src/core/lib/surface/completion_queue.cc
  16. 2
      src/core/lib/transport/byte_stream.cc
  17. 8
      src/core/lib/transport/error_utils.cc
  18. 2
      src/cpp/client/secure_credentials.cc
  19. 6
      src/python/grpcio_tests/tests/unit/_rpc_part_1_test.py
  20. 2
      src/ruby/lib/grpc/errors.rb
  21. 2
      test/cpp/server/server_request_call_test.cc
  22. 2
      tools/internal_ci/linux/grpc_bazel_build_in_docker.sh

13
BUILD

@ -144,8 +144,8 @@ config_setting(
)
config_setting(
name = "use_abseil_status",
values = {"define": "use_abseil_status=true"},
name = "disable_use_abseil_status",
values = {"define": "use_abseil_status=false"},
)
python_config_settings()
@ -2783,6 +2783,7 @@ grpc_cc_library(
"slice_buffer",
"slice_refcount",
"sockaddr_utils",
"status_helper",
"table",
"thread_quota",
"time",
@ -3335,7 +3336,10 @@ grpc_cc_library(
hdrs = [
"src/core/ext/filters/deadline/deadline_filter.h",
],
external_deps = ["absl/types:optional"],
external_deps = [
"absl/status",
"absl/types:optional",
],
language = "c++",
tags = ["grpc-autodeps"],
deps = [
@ -4786,6 +4790,7 @@ grpc_cc_library(
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
],
@ -6123,6 +6128,7 @@ grpc_cc_library(
"resource_quota_trace",
"slice",
"slice_refcount",
"status_helper",
"time",
"uri_parser",
"useful",
@ -6652,6 +6658,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/status",
"absl/time",
"absl/types:optional",
"upb_lib",

@ -178,7 +178,7 @@ def grpc_cc_library(
"//conditions:default": [],
}) +
select({
"//:use_abseil_status": ["GRPC_ERROR_IS_ABSEIL_STATUS=1"],
"//:disable_use_abseil_status": ["GRPC_ERROR_IS_NOT_ABSEIL_STATUS=1"],
"//conditions:default": [],
}),
hdrs = hdrs + public_hdrs,

@ -49,10 +49,11 @@
#endif // GPR_ABSEIL_SYNC
/*
* Defines GRPC_ERROR_IS_ABSEIL_STATUS to use absl::Status for grpc_error_handle
* Defines GRPC_ERROR_IS_NOT_ABSEIL_STATUS to not use absl::Status for
* grpc_error_handle. This is a temporary knob for migration process.
*/
#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
// #define GRPC_ERROR_IS_ABSEIL_STATUS 1
#ifndef GRPC_ERROR_IS_NOT_ABSEIL_STATUS
#define GRPC_ERROR_IS_ABSEIL_STATUS 1
#endif
/* Get windows.h included everywhere (we need it) */

@ -22,6 +22,8 @@
#include <inttypes.h>
#include "absl/status/status.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>

@ -24,6 +24,8 @@
#include <string>
#include <utility>
#include "absl/status/status.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>

@ -20,6 +20,7 @@
#include <new>
#include "absl/status/status.h"
#include "absl/types/optional.h"
#include <grpc/status.h>

@ -28,6 +28,7 @@
#include <type_traits>
#include "absl/meta/type_traits.h"
#include "absl/status/status.h"
#include "absl/types/optional.h"
#include <grpc/compression.h>

@ -27,6 +27,7 @@
#include <new>
#include <type_traits>
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/types/optional.h"

@ -65,6 +65,7 @@
#include "src/core/lib/gprpp/manual_constructor.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/http/parser.h"
#include "src/core/lib/iomgr/combiner.h"

@ -26,6 +26,8 @@
#include <algorithm>
#include "absl/status/status.h"
#include "src/core/ext/transport/chttp2/transport/http2_settings.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/time.h"

@ -23,6 +23,7 @@
#include <string.h>
#include "absl/base/attributes.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include <grpc/slice_buffer.h>

@ -31,6 +31,7 @@
#include <utility>
#include "absl/base/attributes.h"
#include "absl/status/status.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"

@ -24,6 +24,7 @@
#include <string>
#include "absl/base/attributes.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"

@ -29,6 +29,7 @@
#include <string>
#include <utility>
#include "absl/status/status.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"

@ -29,6 +29,7 @@
#include <utility>
#include <vector>
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"

@ -23,6 +23,8 @@
#include <memory>
#include <utility>
#include "absl/status/status.h"
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>

@ -22,13 +22,19 @@
#include <stdint.h>
#include <vector>
#include "absl/strings/string_view.h"
#include <grpc/support/string_util.h>
#include "src/core/lib/iomgr/error_internal.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/transport/status_conversion.h"
#ifndef GRPC_ERROR_IS_ABSEIL_STATUS
#include "src/core/lib/iomgr/error_internal.h"
#endif
static grpc_error_handle recursively_find_error_with_field(
grpc_error_handle error, grpc_error_ints which) {
intptr_t unused;

@ -39,7 +39,7 @@
#include <grpcpp/support/channel_arguments.h>
#include <grpcpp/support/slice.h>
#include <grpcpp/support/status.h>
// TODO(yashykt): We shouldn't be including "src/core" headers.
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"

@ -114,10 +114,8 @@ class RPCPart1Test(BaseRPCTest, unittest.TestCase):
# sanity checks on to make sure returned string contains default members
# of the error
debug_error_string = exception_context.exception.debug_error_string()
self.assertIn('created', debug_error_string)
self.assertIn('description', debug_error_string)
self.assertIn('file', debug_error_string)
self.assertIn('file_line', debug_error_string)
self.assertIn('grpc_status', debug_error_string)
self.assertIn('grpc_message', debug_error_string)
def testFailedUnaryRequestFutureUnaryResponse(self):
request = b'\x37\x17'

@ -43,7 +43,7 @@ module GRPC
debug_error_string = nil)
exception_message = "#{code}:#{details}"
if debug_error_string
exception_message += ". debug_error_string:#{debug_error_string}"
exception_message += ". debug_error_string:{#{debug_error_string}}"
end
super(exception_message)
@code = code

@ -93,7 +93,7 @@ TEST(ServerRequestCallTest, ShortDeadlineDoesNotCauseOkayFalse) {
response.set_message("foobar");
// A bit of sleep to make sure the deadline elapses.
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_MONOTONIC),
gpr_time_from_millis(50, GPR_TIMESPAN)));
gpr_time_from_seconds(1, GPR_TIMESPAN)));
{
std::lock_guard<std::mutex> lock(mu);
if (shutting_down) {

@ -35,7 +35,7 @@ python3 tools/run_tests/python_utils/bazel_report_helper.py --report_path bazel_
bazel_build_with_abseil_status/bazel_wrapper \
--bazelrc=tools/remote_build/include/test_locally_with_resultstore_results.bazelrc \
build \
--define=use_strict_warning=true --define=use_abseil_status=true \
--define=use_strict_warning=true --define=use_abseil_status=false \
-- \
//src/core/... \
//src/compiler/... \

Loading…
Cancel
Save