Removed GRPC_ERROR_NONE (#31131)

pull/30619/head^2
Esun Kim 3 years ago committed by GitHub
parent 6fbff9c6a9
commit d43511f4af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      BUILD
  2. 4
      src/core/ext/filters/channel_idle/channel_idle_filter.cc
  3. 2
      src/core/ext/filters/client_channel/backup_poller.cc
  4. 4
      src/core/ext/filters/client_channel/channel_connectivity.cc
  5. 54
      src/core/ext/filters/client_channel/client_channel.cc
  6. 7
      src/core/ext/filters/client_channel/client_channel.h
  7. 5
      src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc
  8. 2
      src/core/ext/filters/client_channel/lb_policy/oob_backend_metric.cc
  9. 2
      src/core/ext/filters/client_channel/lb_policy/ring_hash/ring_hash.cc
  10. 8
      src/core/ext/filters/client_channel/lb_policy/rls/rls.cc
  11. 2
      src/core/ext/filters/client_channel/lb_policy/xds/cds.cc
  12. 4
      src/core/ext/filters/client_channel/resolver/binder/binder_resolver.cc
  13. 4
      src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc
  14. 4
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_windows.cc
  15. 22
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
  16. 2
      src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h
  17. 2
      src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc
  18. 2
      src/core/ext/filters/client_channel/resolver/xds/xds_resolver.cc
  19. 2
      src/core/ext/filters/client_channel/resolver_result_parsing.cc
  20. 31
      src/core/ext/filters/client_channel/retry_filter.cc
  21. 4
      src/core/ext/filters/client_channel/service_config_channel_arg_filter.cc
  22. 2
      src/core/ext/filters/client_channel/subchannel.cc
  23. 10
      src/core/ext/filters/client_channel/subchannel_stream_client.cc
  24. 8
      src/core/ext/filters/deadline/deadline_filter.cc
  25. 10
      src/core/ext/filters/http/message_compress/message_compress_filter.cc
  26. 17
      src/core/ext/filters/http/message_compress/message_decompress_filter.cc
  27. 8
      src/core/ext/filters/message_size/message_size_filter.cc
  28. 6
      src/core/ext/filters/rbac/rbac_filter.cc
  29. 2
      src/core/ext/filters/server_config_selector/server_config_selector.h
  30. 4
      src/core/ext/transport/binder/client/binder_connector.cc
  31. 2
      src/core/ext/transport/binder/server/binder_server.cc
  32. 4
      src/core/ext/transport/binder/transport/binder_stream.h
  33. 37
      src/core/ext/transport/binder/transport/binder_transport.cc
  34. 2
      src/core/ext/transport/binder/utils/transport_stream_receiver_impl.h
  35. 4
      src/core/ext/transport/binder/wire_format/wire_writer.cc
  36. 6
      src/core/ext/transport/chttp2/client/chttp2_connector.cc
  37. 24
      src/core/ext/transport/chttp2/server/chttp2_server.cc
  38. 75
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  39. 8
      src/core/ext/transport/chttp2/transport/frame_data.cc
  40. 21
      src/core/ext/transport/chttp2/transport/frame_goaway.cc
  41. 5
      src/core/ext/transport/chttp2/transport/frame_ping.cc
  42. 7
      src/core/ext/transport/chttp2/transport/frame_rst_stream.cc
  43. 21
      src/core/ext/transport/chttp2/transport/frame_settings.cc
  44. 5
      src/core/ext/transport/chttp2/transport/frame_window_update.cc
  45. 16
      src/core/ext/transport/chttp2/transport/hpack_parser.cc
  46. 9
      src/core/ext/transport/chttp2/transport/hpack_parser_table.cc
  47. 14
      src/core/ext/transport/chttp2/transport/internal.h
  48. 52
      src/core/ext/transport/chttp2/transport/parsing.cc
  49. 9
      src/core/ext/transport/chttp2/transport/writing.cc
  50. 37
      src/core/ext/transport/cronet/transport/cronet_transport.cc
  51. 50
      src/core/ext/transport/inproc/inproc_transport.cc
  52. 2
      src/core/ext/xds/certificate_provider_store.cc
  53. 2
      src/core/ext/xds/xds_client_grpc.cc
  54. 3
      src/core/ext/xds/xds_route_config.cc
  55. 4
      src/core/lib/address_utils/parse_address.cc
  56. 4
      src/core/lib/channel/channel_stack.cc
  57. 6
      src/core/lib/channel/connected_channel.cc
  58. 20
      src/core/lib/channel/promise_based_filter.cc
  59. 13
      src/core/lib/channel/promise_based_filter.h
  60. 17
      src/core/lib/event_engine/posix_engine/timer.h
  61. 8
      src/core/lib/event_engine/windows/win_socket.cc
  62. 2
      src/core/lib/http/httpcli.cc
  63. 3
      src/core/lib/http/httpcli.h
  64. 2
      src/core/lib/http/httpcli_security_connector.cc
  65. 28
      src/core/lib/http/parser.cc
  66. 2
      src/core/lib/iomgr/buffer_list.cc
  67. 6
      src/core/lib/iomgr/call_combiner.cc
  68. 4
      src/core/lib/iomgr/call_combiner.h
  69. 2
      src/core/lib/iomgr/closure.h
  70. 2
      src/core/lib/iomgr/combiner.cc
  71. 4
      src/core/lib/iomgr/endpoint_cfstream.cc
  72. 4
      src/core/lib/iomgr/endpoint_pair_posix.cc
  73. 14
      src/core/lib/iomgr/error.h
  74. 8
      src/core/lib/iomgr/ev_apple.cc
  75. 18
      src/core/lib/iomgr/ev_epoll1_linux.cc
  76. 15
      src/core/lib/iomgr/ev_poll_posix.cc
  77. 2
      src/core/lib/iomgr/load_file.cc
  78. 4
      src/core/lib/iomgr/lockfree_event.cc
  79. 8
      src/core/lib/iomgr/pollset_windows.cc
  80. 2
      src/core/lib/iomgr/resolve_address_impl.h
  81. 4
      src/core/lib/iomgr/resolve_address_posix.cc
  82. 4
      src/core/lib/iomgr/resolve_address_windows.cc
  83. 38
      src/core/lib/iomgr/socket_utils_common_posix.cc
  84. 4
      src/core/lib/iomgr/socket_windows.cc
  85. 14
      src/core/lib/iomgr/tcp_client_posix.cc
  86. 2
      src/core/lib/iomgr/tcp_client_windows.cc
  87. 16
      src/core/lib/iomgr/tcp_posix.cc
  88. 22
      src/core/lib/iomgr/tcp_server_posix.cc
  89. 2
      src/core/lib/iomgr/tcp_server_utils_posix.h
  90. 4
      src/core/lib/iomgr/tcp_server_utils_posix_common.cc
  91. 10
      src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc
  92. 24
      src/core/lib/iomgr/tcp_server_windows.cc
  93. 12
      src/core/lib/iomgr/tcp_windows.cc
  94. 16
      src/core/lib/iomgr/timer.h
  95. 6
      src/core/lib/iomgr/timer_generic.cc
  96. 6
      src/core/lib/iomgr/wakeup_fd_eventfd.cc
  97. 10
      src/core/lib/iomgr/wakeup_fd_pipe.cc
  98. 2
      src/core/lib/load_balancing/lb_policy.cc
  99. 4
      src/core/lib/promise/exec_ctx_wakeup_scheduler.h
  100. 6
      src/core/lib/security/credentials/external/aws_external_account_credentials.cc
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1688,6 +1688,7 @@ grpc_cc_library(
hdrs = [
"src/core/lib/promise/exec_ctx_wakeup_scheduler.h",
],
external_deps = ["absl/status"],
language = "c++",
deps = [
"closure",
@ -1837,6 +1838,7 @@ grpc_cc_library(
],
external_deps = [
"absl/container:inlined_vector",
"absl/status",
"absl/strings:str_format",
],
language = "c++",
@ -1900,6 +1902,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/strings",
"absl/types:optional",
],
@ -1935,6 +1938,7 @@ grpc_cc_library(
external_deps = [
"absl/base:core_headers",
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
"absl/types:optional",
@ -5700,6 +5704,7 @@ grpc_cc_library(
],
external_deps = [
"absl/memory",
"absl/status",
"absl/status:statusor",
"absl/strings",
],

@ -158,7 +158,7 @@ void MaxAgeFilter::PostInit() {
auto* startup =
new StartupClosure{this->channel_stack()->Ref(), this, grpc_closure{}};
GRPC_CLOSURE_INIT(&startup->closure, run_startup, startup, nullptr);
ExecCtx::Run(DEBUG_LOCATION, &startup->closure, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, &startup->closure, absl::OkStatus());
auto channel_stack = this->channel_stack()->Ref();
@ -187,7 +187,7 @@ void MaxAgeFilter::PostInit() {
ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_CREATE(fn, this->channel_stack(), nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
return Immediate(absl::OkStatus());
},
// Sleep for the grace period

@ -118,7 +118,7 @@ static void g_poller_unref() {
static void run_poller(void* arg, grpc_error_handle error) {
backup_poller* p = static_cast<backup_poller*>(arg);
if (!error.ok()) {
if (error != GRPC_ERROR_CANCELLED) {
if (error != absl::CancelledError()) {
GRPC_LOG_IF_ERROR("run_poller", error);
}
backup_poller_shutdown_unref(p);

@ -18,6 +18,8 @@
#include <inttypes.h>
#include "absl/status/status.h"
#include <grpc/grpc.h>
#include <grpc/impl/codegen/connectivity_state.h>
#include <grpc/impl/codegen/gpr_types.h>
@ -195,7 +197,7 @@ class StateWatcher : public DualRefCounted<StateWatcher> {
grpc_error_handle error =
timer_fired_ ? GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Timed out waiting for connection state change")
: GRPC_ERROR_NONE;
: absl::OkStatus();
grpc_cq_end_op(cq_, tag_, error, FinishedCompletion, this,
&completion_storage_);
}

@ -233,7 +233,7 @@ class ClientChannel::CallData {
grpc_transport_stream_op_batch* pending_batches_[MAX_PENDING_BATCHES] = {};
// Set when we get a cancel_stream op.
grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
grpc_error_handle cancel_error_;
};
//
@ -273,7 +273,7 @@ class DynamicTerminationFilter {
GPR_ASSERT(args->is_last);
GPR_ASSERT(elem->filter == &kFilterVtable);
new (elem->channel_data) DynamicTerminationFilter(args->channel_args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void Destroy(grpc_channel_element* elem) {
@ -300,7 +300,7 @@ class DynamicTerminationFilter::CallData {
static grpc_error_handle Init(grpc_call_element* elem,
const grpc_call_element_args* args) {
new (elem->call_data) CallData(*args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void Destroy(grpc_call_element* elem,
@ -316,7 +316,7 @@ class DynamicTerminationFilter::CallData {
subchannel_call->SetAfterCallStackDestroy(then_schedule_closure);
} else {
// TODO(yashkt) : This can potentially be a Closure::Run
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, absl::OkStatus());
}
}
@ -732,7 +732,7 @@ void ClientChannel::ExternalConnectivityWatcher::Notify(
chand_, on_complete_, /*cancel=*/false);
// Report new state to the user.
*state_ = state;
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, on_complete_, absl::OkStatus());
// Hop back into the work_serializer to clean up.
// Not needed in state SHUTDOWN, because the tracker will
// automatically remove all watchers in that case.
@ -755,7 +755,7 @@ void ClientChannel::ExternalConnectivityWatcher::Cancel() {
std::memory_order_relaxed)) {
return; // Already done.
}
ExecCtx::Run(DEBUG_LOCATION, on_complete_, GRPC_ERROR_CANCELLED);
ExecCtx::Run(DEBUG_LOCATION, on_complete_, absl::CancelledError());
// Hop back into the work_serializer to clean up.
// Note: The callback takes a ref in case the ref inside the state tracker
// gets removed before the callback runs via a SHUTDOWN notification.
@ -769,7 +769,7 @@ void ClientChannel::ExternalConnectivityWatcher::Cancel() {
}
void ClientChannel::ExternalConnectivityWatcher::AddWatcherLocked() {
Closure::Run(DEBUG_LOCATION, watcher_timer_init_, GRPC_ERROR_NONE);
Closure::Run(DEBUG_LOCATION, watcher_timer_init_, absl::OkStatus());
// Add new watcher. Pass the ref of the object from creation to OrphanablePtr.
chand_->state_tracker_.AddWatcher(
initial_state_, OrphanablePtr<ConnectivityStateWatcherInterface>(this));
@ -953,7 +953,7 @@ grpc_error_handle ClientChannel::Init(grpc_channel_element* elem,
grpc_channel_element_args* args) {
GPR_ASSERT(args->is_last);
GPR_ASSERT(elem->filter == &kFilterVtable);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
new (elem->channel_data) ClientChannel(args, &error);
return error;
}
@ -1005,7 +1005,7 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
absl::optional<absl::string_view> service_config_json =
channel_args_.GetString(GRPC_ARG_SERVICE_CONFIG);
if (!service_config_json.has_value()) service_config_json = "{}";
*error = GRPC_ERROR_NONE;
*error = absl::OkStatus();
auto service_config =
ServiceConfigImpl::Create(channel_args_, *service_config_json);
if (!service_config.ok()) {
@ -1055,7 +1055,7 @@ ClientChannel::ClientChannel(grpc_channel_element_args* args,
default_authority_ = std::move(*default_authority);
}
// Success.
*error = GRPC_ERROR_NONE;
*error = absl::OkStatus();
}
ClientChannel::~ClientChannel() {
@ -1319,7 +1319,7 @@ void ClientChannel::OnResolverErrorLocked(absl::Status status) {
call = call->next) {
grpc_call_element* elem = call->elem;
CallData* calld = static_cast<CallData*>(elem->call_data);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (calld->CheckResolutionLocked(elem, &error)) {
calld->AsyncResolutionDone(elem, error);
}
@ -1486,7 +1486,7 @@ void ClientChannel::UpdateServiceConfigInDataPlaneLocked() {
ExecCtx::Get()->InvalidateNow();
grpc_call_element* elem = call->elem;
CallData* calld = static_cast<CallData*>(elem->call_data);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (calld->CheckResolutionLocked(elem, &error)) {
calld->AsyncResolutionDone(elem, error);
}
@ -1584,7 +1584,7 @@ void ClientChannel::UpdateStateAndPickerLocked(
// on the stale value, which results in the timer firing too early. To
// avoid this, we invalidate the cached value for each call we process.
ExecCtx::Get()->InvalidateNow();
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (call->lb_call->PickSubchannelLocked(&error)) {
call->lb_call->AsyncPickDone(error);
}
@ -1650,7 +1650,7 @@ grpc_error_handle ClientChannel::DoPingLocked(grpc_transport_op* op) {
}
connected_subchannel->Ping(op->send_ping.on_initiate,
op->send_ping.on_ack);
return GRPC_ERROR_NONE;
return absl::OkStatus();
},
// Queue pick.
[](LoadBalancingPolicy::PickResult::Queue* /*queue_pick*/) {
@ -1719,7 +1719,7 @@ void ClientChannel::StartTransportOpLocked(grpc_transport_op* op) {
}
}
GRPC_CHANNEL_STACK_UNREF(owning_stack_, "start_transport_op");
ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
}
void ClientChannel::StartTransportOp(grpc_channel_element* elem,
@ -1847,7 +1847,7 @@ grpc_error_handle ClientChannel::CallData::Init(
grpc_call_element* elem, const grpc_call_element_args* args) {
ClientChannel* chand = static_cast<ClientChannel*>(elem->channel_data);
new (elem->call_data) CallData(elem, *chand, *args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void ClientChannel::CallData::Destroy(
@ -1861,7 +1861,7 @@ void ClientChannel::CallData::Destroy(
dynamic_call->SetAfterCallStackDestroy(then_schedule_closure);
} else {
// TODO(yashkt) : This can potentially be a Closure::Run
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, absl::OkStatus());
}
}
@ -1945,7 +1945,7 @@ void ClientChannel::CallData::StartTransportStreamOpBatch(
"config",
chand, calld);
}
CheckResolution(elem, GRPC_ERROR_NONE);
CheckResolution(elem, absl::OkStatus());
} else {
// For all other batches, release the call combiner.
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
@ -2076,7 +2076,7 @@ void ClientChannel::CallData::PendingBatchesResume(grpc_call_element* elem) {
batch->handler_private.extra_arg = elem;
GRPC_CLOSURE_INIT(&batch->handler_private.closure,
ResumePendingBatchInCallCombiner, batch, nullptr);
closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
closures.Add(&batch->handler_private.closure, absl::OkStatus(),
"resuming pending batch from client channel call");
batch = nullptr;
}
@ -2218,7 +2218,7 @@ grpc_error_handle ClientChannel::CallData::ApplyServiceConfigToCallLocked(
// Set the dynamic filter stack.
dynamic_filters_ = chand->dynamic_filters_;
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void ClientChannel::CallData::
@ -2312,7 +2312,7 @@ bool ClientChannel::CallData::CheckResolutionLocked(grpc_call_element* elem,
DEBUG_LOCATION);
},
chand, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
// Get send_initial_metadata batch and flags.
auto& send_initial_metadata =
@ -2364,7 +2364,7 @@ void ClientChannel::CallData::CreateDynamicCall(grpc_call_element* elem) {
arena_,
call_context_,
call_combiner_};
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
DynamicFilters* channel_stack = args.channel_stack.get();
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_call_trace)) {
gpr_log(
@ -2570,7 +2570,7 @@ ClientChannel::LoadBalancedCall::~LoadBalancedCall() {
}
if (on_call_destruction_complete_ != nullptr) {
ExecCtx::Run(DEBUG_LOCATION, on_call_destruction_complete_,
GRPC_ERROR_NONE);
absl::OkStatus());
}
}
@ -2693,7 +2693,7 @@ void ClientChannel::LoadBalancedCall::PendingBatchesResume() {
GRPC_CLOSURE_INIT(&batch->handler_private.closure,
ResumePendingBatchInCallCombiner, batch,
grpc_schedule_on_exec_ctx);
closures.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
closures.Add(&batch->handler_private.closure, absl::OkStatus(),
"resuming pending batch from LB call");
batch = nullptr;
}
@ -2824,7 +2824,7 @@ void ClientChannel::LoadBalancedCall::StartTransportStreamOpBatch(
"chand=%p lb_call=%p: grabbing data plane mutex to perform pick",
chand_, this);
}
PickSubchannel(this, GRPC_ERROR_NONE);
PickSubchannel(this, absl::OkStatus());
} else {
// For all other batches, release the call combiner.
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
@ -2924,7 +2924,7 @@ void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
// Chain to original callback.
if (!self->failure_error_.ok()) {
error = self->failure_error_;
self->failure_error_ = GRPC_ERROR_NONE;
self->failure_error_ = absl::OkStatus();
}
Closure::Run(DEBUG_LOCATION, self->original_recv_trailing_metadata_ready_,
error);
@ -2956,7 +2956,7 @@ void ClientChannel::LoadBalancedCall::CreateSubchannelCall() {
// TODO(roth): When we implement hedging support, we will probably
// need to use a separate call context for each subchannel call.
call_context_, call_combiner_};
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
subchannel_call_ = SubchannelCall::Create(std::move(call_args), &error);
if (GRPC_TRACE_FLAG_ENABLED(grpc_client_channel_lb_call_trace)) {
gpr_log(GPR_INFO,

@ -362,8 +362,7 @@ class ClientChannel {
std::set<SubchannelWrapper*> subchannel_wrappers_
ABSL_GUARDED_BY(*work_serializer_);
int keepalive_time_ ABSL_GUARDED_BY(*work_serializer_) = -1;
grpc_error_handle disconnect_error_ ABSL_GUARDED_BY(*work_serializer_) =
GRPC_ERROR_NONE;
grpc_error_handle disconnect_error_ ABSL_GUARDED_BY(*work_serializer_);
//
// Fields guarded by a mutex, since they need to be accessed
@ -508,10 +507,10 @@ class ClientChannel::LoadBalancedCall
gpr_cycle_counter lb_call_start_time_ = gpr_get_cycle_counter();
// Set when we get a cancel_stream op.
grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
grpc_error_handle cancel_error_;
// Set when we fail inside the LB call.
grpc_error_handle failure_error_ = GRPC_ERROR_NONE;
grpc_error_handle failure_error_;
grpc_closure pick_closure_;

@ -22,6 +22,7 @@
#include <new>
#include "absl/status/status.h"
#include "absl/types/optional.h"
#include <grpc/support/log.h>
@ -36,7 +37,7 @@
static grpc_error_handle clr_init_channel_elem(
grpc_channel_element* /*elem*/, grpc_channel_element_args* /*args*/) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void clr_destroy_channel_elem(grpc_channel_element* /*elem*/) {}
@ -80,7 +81,7 @@ static grpc_error_handle clr_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
GPR_ASSERT(args->context != nullptr);
new (elem->call_data) call_data();
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void clr_destroy_call_elem(grpc_call_element* elem,

@ -263,7 +263,7 @@ class OrcaProducer::OrcaStreamEventHandler
// BackendMetricAllocator object.
void AsyncNotifyWatchersAndDelete() {
GRPC_CLOSURE_INIT(&closure_, NotifyWatchersInExecCtx, this, nullptr);
ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, &closure_, absl::OkStatus());
}
private:

@ -280,7 +280,7 @@ class RingHash : public LoadBalancingPolicy {
void Orphan() override {
// Hop into ExecCtx, so that we're not holding the data plane mutex
// while we run control-plane code.
ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, &closure_, absl::OkStatus());
}
// Will be invoked inside of the WorkSerializer.

@ -1423,7 +1423,7 @@ void RlsLb::Cache::OnCleanupTimer(void* arg, grpc_error_handle error) {
gpr_log(GPR_INFO, "[rlslb %p] cache cleanup timer fired (%s)",
cache->lb_policy_, grpc_error_std_string(error).c_str());
}
if (error == GRPC_ERROR_CANCELLED) return;
if (error == absl::CancelledError()) return;
MutexLock lock(&lb_policy->mu_);
if (lb_policy->is_shutdown_) return;
for (auto it = cache->map_.begin(); it != cache->map_.end();) {
@ -1681,7 +1681,7 @@ RlsLb::RlsRequest::RlsRequest(RefCountedPtr<RlsLb> lb_policy, RequestKey key,
DEBUG_LOCATION,
GRPC_CLOSURE_INIT(&call_start_cb_, StartCall,
Ref(DEBUG_LOCATION, "StartCall").release(), nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
RlsLb::RlsRequest::~RlsRequest() { GPR_ASSERT(call_ == nullptr); }
@ -2073,7 +2073,7 @@ void RlsLb::UpdatePickerAsync() {
GRPC_CLOSURE_CREATE(UpdatePickerCallback,
Ref(DEBUG_LOCATION, "UpdatePickerCallback").release(),
grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
absl::OkStatus());
}
void RlsLb::UpdatePickerCallback(void* arg, grpc_error_handle /*error*/) {
@ -2418,7 +2418,7 @@ void RlsLbConfig::JsonPostLoad(const Json& json, const JsonArgs&,
if (it != json.object_value().end()) {
ValidationErrors::ScopedField field(errors,
".routeLookupChannelServiceConfig");
grpc_error_handle child_error = GRPC_ERROR_NONE;
grpc_error_handle child_error;
rls_channel_service_config_ = it->second.Dump();
auto service_config = MakeRefCounted<ServiceConfigImpl>(
ChannelArgs(), rls_channel_service_config_, it->second, &child_error);

@ -533,7 +533,7 @@ void CdsLb::OnClusterChanged(const std::string& name,
gpr_log(GPR_INFO, "[cdslb %p] generated config for child policy: %s",
this, json_str.c_str());
}
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
auto config =
CoreConfiguration::Get().lb_policy_registry().ParseLoadBalancingConfig(
json);

@ -16,6 +16,8 @@
#include <algorithm>
#include "absl/status/status.h"
#include "src/core/lib/iomgr/port.h" // IWYU pragma: keep
#ifdef GRPC_HAVE_UNIX_SOCKET
@ -113,7 +115,7 @@ class BinderResolverFactory : public ResolverFactory {
memcpy(un->sun_path, path.data(), path.size());
resolved_addr->len =
static_cast<socklen_t>(sizeof(un->sun_family) + path.size() + 1);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static bool ParseUri(const URI& uri, ServerAddressList* addresses) {

@ -407,7 +407,7 @@ AresClientChannelDNSResolver::AresRequestWrapper::OnResolvedLocked(
result.addresses = ServerAddressList();
}
if (service_config_json_ != nullptr) {
grpc_error_handle service_config_error = GRPC_ERROR_NONE;
grpc_error_handle service_config_error;
std::string service_config_string =
ChooseServiceConfig(service_config_json_, &service_config_error);
if (!service_config_error.ok()) {
@ -507,7 +507,7 @@ class AresDNSResolver : public DNSResolver {
grpc_cancel_ares_request(grpc_ares_request_.get());
} else {
completed_ = true;
OnDnsLookupDone(this, GRPC_ERROR_CANCELLED);
OnDnsLookupDone(this, absl::CancelledError());
}
grpc_pollset_set_del_pollset_set(pollset_set_, interested_parties_);
return true;

@ -223,13 +223,13 @@ class GrpcPolledFdWindows {
return;
}
if (socket_type_ == SOCK_DGRAM) {
ScheduleAndNullWriteClosure(GRPC_ERROR_NONE);
ScheduleAndNullWriteClosure(absl::OkStatus());
} else {
GPR_ASSERT(socket_type_ == SOCK_STREAM);
int wsa_error_code = 0;
switch (tcp_write_state_) {
case WRITE_IDLE:
ScheduleAndNullWriteClosure(GRPC_ERROR_NONE);
ScheduleAndNullWriteClosure(absl::OkStatus());
break;
case WRITE_REQUESTED:
tcp_write_state_ = WRITE_PENDING;

@ -368,7 +368,7 @@ static void on_readable(void* arg, grpc_error_handle error) {
ares_process_fd(ev_driver->channel, as, ARES_SOCKET_BAD);
} while (fdn->grpc_polled_fd->IsFdStillReadableLocked());
} else {
// If error is not GRPC_ERROR_NONE, it means the fd has been shutdown or
// If error is not absl::OkStatus(), it means the fd has been shutdown or
// timed out. The pending lookups made on this ev_driver will be cancelled
// by the following ares_cancel() and the on_done callbacks will be invoked
// with a status of ARES_ECANCELLED. The remaining file descriptors in this
@ -392,7 +392,7 @@ static void on_writable(void* arg, grpc_error_handle error) {
if (error.ok()) {
ares_process_fd(ev_driver->channel, ARES_SOCKET_BAD, as);
} else {
// If error is not GRPC_ERROR_NONE, it means the fd has been shutdown or
// If error is not absl::OkStatus(), it means the fd has been shutdown or
// timed out. The pending lookups made on this ev_driver will be cancelled
// by the following ares_cancel() and the on_done callbacks will be invoked
// with a status of ARES_ECANCELLED. The remaining file descriptors in this
@ -541,7 +541,7 @@ grpc_error_handle grpc_ares_ev_driver_create_locked(
(*ev_driver)
->polled_fd_factory->ConfigureAresChannelLocked((*ev_driver)->channel);
(*ev_driver)->query_timeout_ms = query_timeout_ms;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void log_address_sorting_list(const grpc_ares_request* r,
@ -603,7 +603,7 @@ void grpc_ares_complete_request_locked(grpc_ares_request* r)
r->ev_driver = nullptr;
if (r->addresses_out != nullptr && *r->addresses_out != nullptr) {
grpc_cares_wrapper_address_sorting_sort(r, r->addresses_out->get());
r->error = GRPC_ERROR_NONE;
r->error = absl::OkStatus();
// TODO(apolcyn): allow c-ares to return a service config
// with no addresses along side it
}
@ -775,7 +775,7 @@ static void on_txt_done_locked(void* arg, int status, int /*timeouts*/,
const size_t prefix_len = sizeof(g_service_config_attribute_prefix) - 1;
struct ares_txt_ext* result = nullptr;
struct ares_txt_ext* reply = nullptr;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (status != ARES_SUCCESS) goto fail;
GRPC_CARES_TRACE_LOG("request:%p on_txt_done_locked name=%s ARES_SUCCESS", r,
q->name().c_str());
@ -857,7 +857,7 @@ grpc_error_handle set_request_dns_server(grpc_ares_request* r,
"C-ares status is not ARES_SUCCESS: ", ares_strerror(status)));
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
// Common logic for all lookup methods.
@ -867,7 +867,7 @@ grpc_error_handle grpc_dns_lookup_ares_continued(
const char* default_port, grpc_pollset_set* interested_parties,
int query_timeout_ms, std::string* host, std::string* port, bool check_port)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(r->mu) {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
/* parse name, splitting it into host and port parts */
grpc_core::SplitHostPort(name, host, port);
if (host->empty()) {
@ -1087,7 +1087,7 @@ grpc_ares_request* grpc_dns_lookup_srv_ares_impl(
r->balancer_addresses_out = balancer_addresses;
GRPC_CARES_TRACE_LOG(
"request:%p c-ares grpc_dns_lookup_srv_ares_impl name=%s", r, name);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
// Don't query for SRV records if the target is "localhost"
if (target_matches_localhost(name)) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
@ -1125,7 +1125,7 @@ grpc_ares_request* grpc_dns_lookup_txt_ares_impl(
r->service_config_json_out = service_config_json;
GRPC_CARES_TRACE_LOG(
"request:%p c-ares grpc_dns_lookup_txt_ares_impl name=%s", r, name);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
// Don't query for TXT records if the target is "localhost"
if (target_matches_localhost(name)) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, r->on_done, error);
@ -1193,12 +1193,12 @@ grpc_error_handle grpc_ares_init(void) {
return GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("ares_library_init failed: ", ares_strerror(status)));
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void grpc_ares_cleanup(void) { ares_library_cleanup(); }
#else
grpc_error_handle grpc_ares_init(void) { return GRPC_ERROR_NONE; }
grpc_error_handle grpc_ares_init(void) { return absl::OkStatus(); }
void grpc_ares_cleanup(void) {}
#endif // GPR_WINDOWS

@ -75,7 +75,7 @@ struct grpc_ares_request {
/** number of ongoing queries */
size_t pending_queries ABSL_GUARDED_BY(mu) = 0;
/** the errors explaining query failures, appended to in query callbacks */
grpc_error_handle error ABSL_GUARDED_BY(mu) = GRPC_ERROR_NONE;
grpc_error_handle error ABSL_GUARDED_BY(mu);
};
/* Asynchronously resolve \a name (A/AAAA records only).

@ -88,7 +88,7 @@ class GoogleCloud2ProdResolver : public Resolver {
private:
static void OnHttpRequestDone(void* arg, grpc_error_handle error);
// If error is not GRPC_ERROR_NONE, then it's not safe to look at response.
// If error is not absl::OkStatus(), then it's not safe to look at response.
virtual void OnDone(GoogleCloud2ProdResolver* resolver,
const grpc_http_response* response,
grpc_error_handle error) = 0;

@ -793,7 +793,7 @@ ConfigSelector::CallConfig XdsResolver::XdsConfigSelector::GetCallConfig(
//
void XdsResolver::StartLocked() {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
auto xds_client = GrpcXdsClient::GetOrCreate(args_, "xds resolver");
if (!xds_client.ok()) {
gpr_log(GPR_ERROR,

@ -128,7 +128,7 @@ ClientChannelServiceConfigParser::ParseGlobalParams(const ChannelArgs& /*args*/,
absl::optional<std::string> health_check_service_name;
it = json.object_value().find("healthCheckConfig");
if (it != json.object_value().end()) {
grpc_error_handle parsing_error = GRPC_ERROR_NONE;
grpc_error_handle parsing_error;
health_check_service_name =
ParseHealthCheckConfig(it->second, &parsing_error);
if (!parsing_error.ok()) {

@ -28,6 +28,7 @@
#include <utility>
#include "absl/container/inlined_vector.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@ -148,7 +149,7 @@ class RetryFilter {
grpc_channel_element_args* args) {
GPR_ASSERT(args->is_last);
GPR_ASSERT(elem->filter == &kRetryFilterVtable);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
new (elem->channel_data) RetryFilter(args->channel_args, &error);
return error;
}
@ -490,9 +491,9 @@ class RetryFilter::CallData {
bool sent_cancel_stream_ : 1;
// State for callback processing.
RefCountedPtr<BatchData> recv_initial_metadata_ready_deferred_batch_;
grpc_error_handle recv_initial_metadata_error_ = GRPC_ERROR_NONE;
grpc_error_handle recv_initial_metadata_error_;
RefCountedPtr<BatchData> recv_message_ready_deferred_batch_;
grpc_error_handle recv_message_error_ = GRPC_ERROR_NONE;
grpc_error_handle recv_message_error_;
struct OnCompleteDeferredBatch {
OnCompleteDeferredBatch(RefCountedPtr<BatchData> batch,
grpc_error_handle error)
@ -504,7 +505,7 @@ class RetryFilter::CallData {
absl::InlinedVector<OnCompleteDeferredBatch, 3>
on_complete_deferred_batches_;
RefCountedPtr<BatchData> recv_trailing_metadata_internal_batch_;
grpc_error_handle recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
grpc_error_handle recv_trailing_metadata_error_;
bool seen_recv_trailing_metadata_from_surface_ : 1;
// NOTE: Do not move this next to the metadata bitfields above. That would
// save space but will also result in a data race because compiler
@ -574,7 +575,7 @@ class RetryFilter::CallData {
CallCombiner* call_combiner_;
grpc_call_context_element* call_context_;
grpc_error_handle cancelled_from_surface_ = GRPC_ERROR_NONE;
grpc_error_handle cancelled_from_surface_;
RefCountedPtr<CallStackDestructionBarrier> call_stack_destruction_barrier_;
@ -662,7 +663,7 @@ class RetryFilter::CallData::CallStackDestructionBarrier
~CallStackDestructionBarrier() override {
// TODO(yashkt) : This can potentially be a Closure::Run
ExecCtx::Run(DEBUG_LOCATION, on_call_stack_destruction_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, on_call_stack_destruction_, absl::OkStatus());
}
// Set the closure from the surface. This closure will be invoked
@ -900,7 +901,7 @@ void RetryFilter::CallData::CallAttempt::AddClosureForBatch(
batch->handler_private.extra_arg = lb_call_.get();
GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
batch, grpc_schedule_on_exec_ctx);
closures->Add(&batch->handler_private.closure, GRPC_ERROR_NONE, reason);
closures->Add(&batch->handler_private.closure, absl::OkStatus(), reason);
}
void RetryFilter::CallData::CallAttempt::
@ -1019,7 +1020,7 @@ void RetryFilter::CallData::CallAttempt::AddBatchesForPendingBatches(
"internally started recv_trailing_metadata batch pending and "
"recv_trailing_metadata started from surface");
}
recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
recv_trailing_metadata_error_ = absl::OkStatus();
}
// We don't want the fact that we've already started this op internally
// to prevent us from adding a batch that may contain other ops.
@ -1233,15 +1234,15 @@ void RetryFilter::CallData::CallAttempt::Abandon() {
DEBUG_LOCATION,
"unref internal recv_trailing_metadata_ready batch; attempt abandoned");
}
recv_trailing_metadata_error_ = GRPC_ERROR_NONE;
recv_trailing_metadata_error_ = absl::OkStatus();
recv_initial_metadata_ready_deferred_batch_.reset(
DEBUG_LOCATION,
"unref deferred recv_initial_metadata_ready batch; attempt abandoned");
recv_initial_metadata_error_ = GRPC_ERROR_NONE;
recv_initial_metadata_error_ = absl::OkStatus();
recv_message_ready_deferred_batch_.reset(
DEBUG_LOCATION,
"unref deferred recv_message_ready batch; attempt abandoned");
recv_message_error_ = GRPC_ERROR_NONE;
recv_message_error_ = absl::OkStatus();
for (auto& on_complete_deferred_batch : on_complete_deferred_batches_) {
on_complete_deferred_batch.batch.reset(
DEBUG_LOCATION, "unref deferred on_complete batch; attempt abandoned");
@ -1654,7 +1655,7 @@ void RetryFilter::CallData::CallAttempt::BatchData::
call_attempt_->recv_initial_metadata_error_, closures);
call_attempt_->recv_initial_metadata_ready_deferred_batch_.reset(
DEBUG_LOCATION, "resuming deferred recv_initial_metadata_ready");
call_attempt_->recv_initial_metadata_error_ = GRPC_ERROR_NONE;
call_attempt_->recv_initial_metadata_error_ = absl::OkStatus();
}
// Add closure for deferred recv_message_ready.
if (GPR_UNLIKELY(call_attempt_->recv_message_ready_deferred_batch_ !=
@ -1663,7 +1664,7 @@ void RetryFilter::CallData::CallAttempt::BatchData::
closures);
call_attempt_->recv_message_ready_deferred_batch_.reset(
DEBUG_LOCATION, "resuming deferred recv_message_ready");
call_attempt_->recv_message_error_ = GRPC_ERROR_NONE;
call_attempt_->recv_message_error_ = absl::OkStatus();
}
// Add closures for deferred on_complete callbacks.
for (auto& on_complete_deferred_batch :
@ -2087,7 +2088,7 @@ grpc_error_handle RetryFilter::CallData::Init(
gpr_log(GPR_INFO, "chand=%p calld=%p: created call", chand,
elem->call_data);
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void RetryFilter::CallData::Destroy(grpc_call_element* elem,
@ -2624,7 +2625,7 @@ void RetryFilter::CallData::AddClosureToStartTransparentRetry(
}
GRPC_CALL_STACK_REF(owning_call_, "OnRetryTimer");
GRPC_CLOSURE_INIT(&retry_closure_, StartTransparentRetry, this, nullptr);
closures->Add(&retry_closure_, GRPC_ERROR_NONE, "start transparent retry");
closures->Add(&retry_closure_, absl::OkStatus(), "start transparent retry");
}
void RetryFilter::CallData::StartTransparentRetry(void* arg,

@ -114,7 +114,7 @@ grpc_error_handle ServiceConfigChannelArgInitCallElem(
}
new (calld) ServiceConfigChannelArgCallData(std::move(service_config),
method_config, args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void ServiceConfigChannelArgDestroyCallElem(
@ -130,7 +130,7 @@ grpc_error_handle ServiceConfigChannelArgInitChannelElem(
ServiceConfigChannelArgChannelData* chand =
static_cast<ServiceConfigChannelArgChannelData*>(elem->channel_data);
new (chand) ServiceConfigChannelArgChannelData(args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void ServiceConfigChannelArgDestroyChannelElem(grpc_channel_element* elem) {

@ -362,7 +362,7 @@ class Subchannel::AsyncWatcherNotifierLocked {
delete self;
},
this, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
private:

@ -196,7 +196,7 @@ SubchannelStreamClient::CallState::~CallState() {
}
void SubchannelStreamClient::CallState::Orphan() {
call_combiner_.Cancel(GRPC_ERROR_CANCELLED);
call_combiner_.Cancel(absl::CancelledError());
Cancel();
}
@ -211,7 +211,7 @@ void SubchannelStreamClient::CallState::StartCallLocked() {
context_,
&call_combiner_,
};
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
call_ = SubchannelCall::Create(std::move(args), &error).release();
// Register after-destruction callback.
GRPC_CLOSURE_INIT(&after_call_stack_destruction_, AfterCallStackDestruction,
@ -304,7 +304,7 @@ void SubchannelStreamClient::CallState::StartBatch(
GRPC_CLOSURE_INIT(&batch->handler_private.closure, StartBatchInCallCombiner,
batch, grpc_schedule_on_exec_ctx);
GRPC_CALL_COMBINER_START(&call_combiner_, &batch->handler_private.closure,
GRPC_ERROR_NONE, "start_subchannel_batch");
absl::OkStatus(), "start_subchannel_batch");
}
void SubchannelStreamClient::CallState::AfterCallStackDestruction(
@ -326,7 +326,7 @@ void SubchannelStreamClient::CallState::StartCancel(
auto* batch = grpc_make_transport_stream_op(
GRPC_CLOSURE_CREATE(OnCancelComplete, self, grpc_schedule_on_exec_ctx));
batch->cancel_stream = true;
batch->payload->cancel_stream.cancel_error = GRPC_ERROR_CANCELLED;
batch->payload->cancel_stream.cancel_error = absl::CancelledError();
self->call_->StartTransportStreamOpBatch(batch);
}
@ -339,7 +339,7 @@ void SubchannelStreamClient::CallState::Cancel() {
GRPC_CALL_COMBINER_START(
&call_combiner_,
GRPC_CLOSURE_CREATE(StartCancel, this, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE, "health_cancel");
absl::OkStatus(), "health_cancel");
}
}

@ -82,7 +82,7 @@ class TimerState {
TimerState* self = static_cast<TimerState*>(arg);
grpc_deadline_state* deadline_state =
static_cast<grpc_deadline_state*>(self->elem_->call_data);
if (error != GRPC_ERROR_CANCELLED) {
if (error != absl::CancelledError()) {
error = grpc_error_set_int(
GRPC_ERROR_CREATE_FROM_STATIC_STRING("Deadline Exceeded"),
GRPC_ERROR_INT_GRPC_STATUS, GRPC_STATUS_DEADLINE_EXCEEDED);
@ -211,7 +211,7 @@ grpc_deadline_state::grpc_deadline_state(grpc_call_element* elem,
new start_timer_after_init_state(elem, deadline);
GRPC_CLOSURE_INIT(&state->closure, start_timer_after_init, state,
grpc_schedule_on_exec_ctx);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &state->closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &state->closure, absl::OkStatus());
}
}
@ -248,7 +248,7 @@ void grpc_deadline_state_client_start_transport_stream_op_batch(
static grpc_error_handle deadline_init_channel_elem(
grpc_channel_element* /*elem*/, grpc_channel_element_args* args) {
GPR_ASSERT(!args->is_last);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
// Destructor for channel_data. Used for both client and server filters.
@ -275,7 +275,7 @@ typedef struct server_call_data {
static grpc_error_handle deadline_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) grpc_deadline_state(elem, *args, args->deadline);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
// Destructor for call_data. Used for both client and server filters.

@ -27,6 +27,7 @@
#include <utility>
#include "absl/meta/type_traits.h"
#include "absl/status/status.h"
#include "absl/types/optional.h"
#include <grpc/compression.h>
@ -122,7 +123,7 @@ class CallData {
grpc_core::CallCombiner* call_combiner_;
grpc_compression_algorithm compression_algorithm_ = GRPC_COMPRESS_NONE;
grpc_error_handle cancel_error_ = GRPC_ERROR_NONE;
grpc_error_handle cancel_error_;
grpc_transport_stream_op_batch* send_message_batch_ = nullptr;
bool seen_initial_metadata_ = false;
grpc_closure forward_send_message_batch_in_call_combiner_;
@ -256,7 +257,8 @@ void CallData::CompressStartTransportStreamOpBatch(
if (send_message_batch_ != nullptr) {
GRPC_CALL_COMBINER_START(
call_combiner_, &forward_send_message_batch_in_call_combiner_,
GRPC_ERROR_NONE, "starting send_message after send_initial_metadata");
absl::OkStatus(),
"starting send_message after send_initial_metadata");
}
}
// Handle send_message.
@ -288,7 +290,7 @@ void CompressStartTransportStreamOpBatch(
grpc_error_handle CompressInitCallElem(grpc_call_element* elem,
const grpc_call_element_args* args) {
new (elem->call_data) CallData(elem, *args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* Destructor for call_data */
@ -303,7 +305,7 @@ void CompressDestroyCallElem(grpc_call_element* elem,
grpc_error_handle CompressInitChannelElem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
new (elem->channel_data) ChannelData(args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* Destructor for channel data */

@ -25,6 +25,7 @@
#include <new>
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
#include "absl/types/optional.h"
@ -108,7 +109,7 @@ class CallData {
CallCombiner* call_combiner_;
// Overall error for the call
grpc_error_handle error_ = GRPC_ERROR_NONE;
grpc_error_handle error_;
// Fields for handling recv_initial_metadata_ready callback
grpc_closure on_recv_initial_metadata_ready_;
grpc_closure* original_recv_initial_metadata_ready_ = nullptr;
@ -125,7 +126,7 @@ class CallData {
bool seen_recv_trailing_metadata_ready_ = false;
grpc_closure on_recv_trailing_metadata_ready_;
grpc_closure* original_recv_trailing_metadata_ready_ = nullptr;
grpc_error_handle on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
grpc_error_handle on_recv_trailing_metadata_ready_error_;
};
void CallData::OnRecvInitialMetadataReady(void* arg, grpc_error_handle error) {
@ -146,7 +147,7 @@ void CallData::MaybeResumeOnRecvMessageReady() {
if (seen_recv_message_ready_) {
seen_recv_message_ready_ = false;
GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_message_ready_,
GRPC_ERROR_NONE,
absl::OkStatus(),
"continue recv_message_ready callback");
}
}
@ -167,7 +168,7 @@ void CallData::OnRecvMessageReady(void* arg, grpc_error_handle error) {
if (!calld->recv_message_->has_value() ||
(*calld->recv_message_)->Length() == 0 ||
((*calld->recv_message_flags_ & GRPC_WRITE_INTERNAL_COMPRESS) == 0)) {
return calld->ContinueRecvMessageReadyCallback(GRPC_ERROR_NONE);
return calld->ContinueRecvMessageReadyCallback(absl::OkStatus());
}
if (calld->max_recv_message_length_ >= 0 &&
(*calld->recv_message_)->Length() >
@ -214,7 +215,7 @@ void CallData::MaybeResumeOnRecvTrailingMetadataReady() {
if (seen_recv_trailing_metadata_ready_) {
seen_recv_trailing_metadata_ready_ = false;
grpc_error_handle error = on_recv_trailing_metadata_ready_error_;
on_recv_trailing_metadata_ready_error_ = GRPC_ERROR_NONE;
on_recv_trailing_metadata_ready_error_ = absl::OkStatus();
GRPC_CALL_COMBINER_START(call_combiner_, &on_recv_trailing_metadata_ready_,
error, "Continuing OnRecvTrailingMetadataReady");
}
@ -233,7 +234,7 @@ void CallData::OnRecvTrailingMetadataReady(void* arg, grpc_error_handle error) {
return;
}
error = grpc_error_add_child(error, calld->error_);
calld->error_ = GRPC_ERROR_NONE;
calld->error_ = absl::OkStatus();
grpc_closure* closure = calld->original_recv_trailing_metadata_ready_;
calld->original_recv_trailing_metadata_ready_ = nullptr;
Closure::Run(DEBUG_LOCATION, closure, error);
@ -279,7 +280,7 @@ grpc_error_handle DecompressInitCallElem(grpc_call_element* elem,
const grpc_call_element_args* args) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
new (elem->call_data) CallData(*args, chand);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void DecompressDestroyCallElem(grpc_call_element* elem,
@ -293,7 +294,7 @@ grpc_error_handle DecompressInitChannelElem(grpc_channel_element* elem,
grpc_channel_element_args* args) {
ChannelData* chand = static_cast<ChannelData*>(elem->channel_data);
new (chand) ChannelData(args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void DecompressDestroyChannelElem(grpc_channel_element* elem) {

@ -195,8 +195,8 @@ struct call_data {
// call our next_recv_message_ready member after handling it.
grpc_closure recv_message_ready;
grpc_closure recv_trailing_metadata_ready;
// The error caused by a message that is too large, or GRPC_ERROR_NONE
grpc_error_handle error = GRPC_ERROR_NONE;
// The error caused by a message that is too large, or absl::OkStatus()
grpc_error_handle error;
// Used by recv_message_ready.
absl::optional<grpc_core::SliceBuffer>* recv_message = nullptr;
// Original recv_message_ready callback, invoked after our own.
@ -305,7 +305,7 @@ static grpc_error_handle message_size_init_call_elem(
grpc_call_element* elem, const grpc_call_element_args* args) {
channel_data* chand = static_cast<channel_data*>(elem->channel_data);
new (elem->call_data) call_data(elem, *chand, *args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
// Destructor for call_data.
@ -332,7 +332,7 @@ static grpc_error_handle message_size_init_channel_elem(
new (chand) channel_data();
chand->limits = get_message_size_limits(
grpc_core::ChannelArgs::FromC(args->channel_args));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
// Destructor for channel_data.

@ -21,6 +21,8 @@
#include <new>
#include <utility>
#include "absl/status/status.h"
#include <grpc/status.h>
#include <grpc/support/log.h>
@ -45,7 +47,7 @@ namespace grpc_core {
grpc_error_handle RbacFilter::CallData::Init(
grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) CallData(elem, *args);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void RbacFilter::CallData::Destroy(grpc_call_element* elem,
@ -157,7 +159,7 @@ grpc_error_handle RbacFilter::Init(grpc_channel_element* elem,
grpc_channel_stack_filter_instance_number(args->channel_stack, elem),
EvaluateArgs::PerChannelArgs(auth_context,
grpc_transport_get_endpoint(transport)));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void RbacFilter::Destroy(grpc_channel_element* elem) {

@ -43,7 +43,7 @@ class ServerConfigSelector : public RefCounted<ServerConfigSelector> {
public:
// Configuration to apply to an incoming call
struct CallConfig {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
const ServiceConfigParser::ParsedConfigVector* method_configs = nullptr;
RefCountedPtr<ServiceConfig> service_config;
};

@ -92,9 +92,9 @@ class BinderConnector : public grpc_core::SubchannelConnector {
// might be invoked from non-gRPC code
if (grpc_core::ExecCtx::Get() == nullptr) {
grpc_core::ExecCtx exec_ctx;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, absl::OkStatus());
} else {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, notify_, absl::OkStatus());
}
Unref(); // Was referenced in BinderConnector::Connect

@ -164,7 +164,7 @@ class BinderServerListener : public Server::ListenerInterface {
~BinderServerListener() override {
ExecCtx::Get()->Flush();
if (on_destroy_done_) {
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, absl::OkStatus());
ExecCtx::Get()->Flush();
}
grpc_remove_endpoint_binder(addr_);

@ -70,7 +70,7 @@ struct grpc_binder_stream {
~grpc_binder_stream() {
if (destroy_stream_then_closure != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_then_closure,
GRPC_ERROR_NONE);
absl::OkStatus());
}
}
@ -87,7 +87,7 @@ struct grpc_binder_stream {
grpc_closure destroy_stream;
// The reason why this stream is cancelled and closed.
grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
grpc_error_handle cancel_self_error;
grpc_closure recv_initial_metadata_closure;
RecvInitialMetadataArgs recv_initial_metadata_args;

@ -119,7 +119,7 @@ static int init_stream(grpc_transport* gt, grpc_stream* gs,
t->combiner->Run(
GRPC_CLOSURE_INIT(&gbs->register_stream_closure, register_stream_locked,
&gbs->register_stream_args, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
return 0;
}
@ -217,7 +217,7 @@ static void recv_initial_metadata_locked(void* arg,
}
}
AssignMetadata(gbs->recv_initial_metadata, *args->initial_metadata);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}();
grpc_closure* cb = gbs->recv_initial_metadata_ready;
@ -247,7 +247,7 @@ static void recv_message_locked(void* arg, grpc_error_handle /*error*/) {
gpr_log(GPR_ERROR, "message cancelled gracefully");
// Cancelled because we've already received trailing metadata.
// It's not an error in this case.
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else {
return absl_status_to_grpc_error(args->message.status());
}
@ -255,7 +255,7 @@ static void recv_message_locked(void* arg, grpc_error_handle /*error*/) {
grpc_core::SliceBuffer buf;
buf.Append(grpc_core::Slice(grpc_slice_from_cpp_string(*args->message)));
*gbs->recv_message = std::move(buf);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}();
if (!error.ok() && gbs->call_failed_before_recv_message != nullptr) {
@ -291,7 +291,7 @@ static void recv_trailing_metadata_locked(void* arg,
// Client will not send non-empty trailing metadata.
if (!args->trailing_metadata.value().empty()) {
gpr_log(GPR_ERROR, "Server receives non-empty trailing metadata.");
return GRPC_ERROR_CANCELLED;
return absl::CancelledError();
}
} else {
AssignMetadata(gbs->recv_trailing_metadata, *args->trailing_metadata);
@ -303,7 +303,7 @@ static void recv_trailing_metadata_locked(void* arg,
grpc_core::GrpcStatusMetadata(),
static_cast<grpc_status_code>(args->status));
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}();
if (gbs->is_client || gbs->trailing_metadata_sent) {
@ -394,7 +394,8 @@ static void perform_stream_op_locked(void* stream_op,
}
cancel_stream_locked(gbt, gbs, op->payload->cancel_stream.cancel_error);
if (op->on_complete != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
absl::OkStatus());
}
GRPC_BINDER_STREAM_UNREF(gbs, "perform_stream_op");
return;
@ -481,7 +482,7 @@ static void perform_stream_op_locked(void* stream_op,
GRPC_CLOSURE_INIT(&gbs->recv_initial_metadata_closure,
recv_initial_metadata_locked,
&gbs->recv_initial_metadata_args, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
});
}
if (op->recv_message) {
@ -499,7 +500,7 @@ static void perform_stream_op_locked(void* stream_op,
gbt->combiner->Run(
GRPC_CLOSURE_INIT(&gbs->recv_message_closure, recv_message_locked,
&gbs->recv_message_args, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
});
}
if (op->recv_trailing_metadata) {
@ -522,11 +523,11 @@ static void perform_stream_op_locked(void* stream_op,
GRPC_CLOSURE_INIT(&gbs->recv_trailing_metadata_closure,
recv_trailing_metadata_locked,
&gbs->recv_trailing_metadata_args, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
});
}
// Only send transaction when there's a send op presented.
absl::Status status = absl::OkStatus();
absl::Status status;
if (op->send_initial_metadata || op->send_message ||
op->send_trailing_metadata) {
status = gbt->wire_writer->RpcCall(std::move(tx));
@ -541,7 +542,7 @@ static void perform_stream_op_locked(void* stream_op,
if (gbs->need_to_call_trailing_metadata_callback) {
grpc_closure* cb = gbs->recv_trailing_metadata_finished;
gbs->recv_trailing_metadata_finished = nullptr;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, absl::OkStatus());
gbs->need_to_call_trailing_metadata_callback = false;
}
}
@ -566,7 +567,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
op->handler_private.extra_arg = gbs;
gbt->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
perform_stream_op_locked, op, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void close_transport_locked(grpc_binder_transport* gbt) {
@ -599,7 +600,7 @@ static void perform_transport_op_locked(void* transport_op,
gbt->accept_stream_user_data = op->set_accept_stream_user_data;
}
if (op->on_consumed) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
}
bool do_close = false;
if (!op->disconnect_with_error.ok()) {
@ -622,7 +623,7 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
gbt->combiner->Run(
GRPC_CLOSURE_INIT(&op->handler_private.closure,
perform_transport_op_locked, op, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void destroy_stream_locked(void* sp, grpc_error_handle /*error*/) {
@ -642,7 +643,7 @@ static void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
gbs->destroy_stream_then_closure = then_schedule_closure;
gbs->t->combiner->Run(GRPC_CLOSURE_INIT(&gbs->destroy_stream,
destroy_stream_locked, gbs, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void destroy_transport_locked(void* gt, grpc_error_handle /*error*/) {
@ -660,7 +661,7 @@ static void destroy_transport(grpc_transport* gt) {
grpc_binder_transport* gbt = reinterpret_cast<grpc_binder_transport*>(gt);
gbt->combiner->Run(
GRPC_CLOSURE_CREATE(destroy_transport_locked, gbt, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static grpc_endpoint* get_endpoint(grpc_transport*) {
@ -708,7 +709,7 @@ grpc_binder_transport::grpc_binder_transport(
grpc_core::ExecCtx exec_ctx;
combiner->Run(
GRPC_CLOSURE_CREATE(accept_stream_locked, this, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
});
// WireReader holds a ref to grpc_binder_transport.
GRPC_BINDER_REF_TRANSPORT(this, "wire reader");

@ -58,7 +58,7 @@ class TransportStreamReceiverImpl : public TransportStreamReceiver {
// never be in-coming message data anymore, and all recv_message callbacks
// (as well as recv_initial_metadata callback, if there's any) registered will
// never be satisfied. This function cancels all such callbacks gracefully
// (with GRPC_ERROR_NONE) to avoid being blocked waiting for them.
// (with absl::OkStatus()) to avoid being blocked waiting for them.
void OnRecvTrailingMetadata(StreamIdentifier id);
void CancelInitialMetadataCallback(StreamIdentifier id, absl::Status error);

@ -301,7 +301,7 @@ absl::Status WireWriterImpl::SendAck(int64_t num_bytes) {
args->tx = RunScheduledTxArgs::AckTx();
absl::get<RunScheduledTxArgs::AckTx>(args->tx).num_bytes = num_bytes;
auto cl = GRPC_CLOSURE_CREATE(RunScheduledTx, args, nullptr);
combiner_->Run(cl, GRPC_ERROR_NONE);
combiner_->Run(cl, absl::OkStatus());
return absl::OkStatus();
}
// Otherwise, we can directly send ack.
@ -378,7 +378,7 @@ void WireWriterImpl::TryScheduleTransaction() {
num_non_acked_tx_in_combiner_++;
combiner_->Run(GRPC_CLOSURE_CREATE(RunScheduledTx,
pending_outgoing_tx_.front(), nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
pending_outgoing_tx_.pop();
} else {
// It is common to fill `kFlowControlWindowSize` completely because

@ -209,7 +209,7 @@ void Chttp2Connector::OnReceiveSettings(void* arg, grpc_error_handle error) {
} else {
// OnTimeout() was already invoked. Call Notify() again so that notify_
// can be invoked.
self->MaybeNotify(GRPC_ERROR_NONE);
self->MaybeNotify(absl::OkStatus());
}
}
self->Unref();
@ -233,7 +233,7 @@ void Chttp2Connector::OnTimeout(void* arg, grpc_error_handle /*error*/) {
} else {
// OnReceiveSettings() was already invoked. Call Notify() again so that
// notify_ can be invoked.
self->MaybeNotify(GRPC_ERROR_NONE);
self->MaybeNotify(absl::OkStatus());
}
}
self->Unref();
@ -344,7 +344,7 @@ grpc_channel* grpc_channel_create(const char* target,
GRPC_API_TRACE("grpc_secure_channel_create(target=%s, creds=%p, args=%p)", 3,
(target, (void*)creds, (void*)c_args));
grpc_channel* channel = nullptr;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (creds != nullptr) {
// Add channel args containing the client channel factory and channel
// credentials.

@ -412,9 +412,9 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::Start(
void Chttp2ServerListener::ActiveConnection::HandshakingState::OnTimeout(
void* arg, grpc_error_handle error) {
HandshakingState* self = static_cast<HandshakingState*>(arg);
// Note that we may be called with GRPC_ERROR_NONE when the timer fires
// Note that we may be called with absl::OkStatus() when the timer fires
// or with an error indicating that the timer system is being shut down.
if (error != GRPC_ERROR_CANCELLED) {
if (error != absl::CancelledError()) {
grpc_transport_op* op = grpc_make_transport_op(nullptr);
op->disconnect_with_error = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Did not receive HTTP/2 settings before handshake timeout");
@ -455,7 +455,7 @@ void Chttp2ServerListener::ActiveConnection::HandshakingState::OnHandshakeDone(
// before destroying them, even if we know that there are no
// pending read/write callbacks. This should be fixed, at which
// point this can be removed.
grpc_endpoint_shutdown(args->endpoint, GRPC_ERROR_NONE);
grpc_endpoint_shutdown(args->endpoint, absl::OkStatus());
grpc_endpoint_destroy(args->endpoint);
grpc_slice_buffer_destroy(args->read_buffer);
gpr_free(args->read_buffer);
@ -675,7 +675,7 @@ grpc_error_handle Chttp2ServerListener::Create(
// The bulk of this method is inside of a lambda to make cleanup
// easier without using goto.
grpc_error_handle error = [&]() {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
// Create Chttp2ServerListener.
listener = new Chttp2ServerListener(server, args, args_modifier);
error = grpc_tcp_server_create(
@ -706,7 +706,7 @@ grpc_error_handle Chttp2ServerListener::Create(
}
// Register with the server only upon success
server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}();
if (!error.ok()) {
if (listener != nullptr) {
@ -738,7 +738,7 @@ grpc_error_handle Chttp2ServerListener::CreateWithAcceptor(
TcpServerFdHandler** arg_val = args.GetPointer<TcpServerFdHandler*>(name);
*arg_val = grpc_tcp_server_create_fd_handler(listener->tcp_server_);
server->AddListener(OrphanablePtr<Server::ListenerInterface>(listener));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
Chttp2ServerListener::Chttp2ServerListener(
@ -757,7 +757,7 @@ Chttp2ServerListener::~Chttp2ServerListener() {
// may do a synchronous unref.
ExecCtx::Get()->Flush();
if (on_destroy_done_ != nullptr) {
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, on_destroy_done_, absl::OkStatus());
ExecCtx::Get()->Flush();
}
}
@ -822,7 +822,7 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
GRPC_ERROR_CREATE_FROM_CPP_STRING(args_result.status().ToString()));
return;
}
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
args = self->args_modifier_(*args_result, &error);
if (!error.ok()) {
gpr_log(GPR_DEBUG, "Closing connection: %s",
@ -857,7 +857,7 @@ void Chttp2ServerListener::OnAccept(void* arg, grpc_endpoint* tcp,
}
}
if (connection != nullptr) {
endpoint_cleanup(GRPC_ERROR_NONE);
endpoint_cleanup(absl::OkStatus());
} else {
connection_ref->Start(std::move(listener_ref), tcp, args);
}
@ -923,7 +923,7 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
absl::string_view parsed_addr_unprefixed{parsed_addr};
// Using lambda to avoid use of goto.
grpc_error_handle error = [&]() {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (absl::ConsumePrefix(&parsed_addr_unprefixed, kUnixUriPrefix)) {
resolved_or = grpc_resolve_unix_domain_address(parsed_addr_unprefixed);
} else if (absl::ConsumePrefix(&parsed_addr_unprefixed,
@ -973,7 +973,7 @@ grpc_error_handle Chttp2ServerAddPort(Server* server, const char* addr,
gpr_log(GPR_INFO, "WARNING: %s", grpc_error_std_string(error).c_str());
// we managed to bind some addresses: continue without error
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}(); // lambda end
if (!error.ok()) *port_num = 0;
return error;
@ -1005,7 +1005,7 @@ ChannelArgs ModifyArgsForConnection(const ChannelArgs& args,
int grpc_server_add_http2_port(grpc_server* server, const char* addr,
grpc_server_credentials* creds) {
grpc_core::ExecCtx exec_ctx;
grpc_error_handle err = GRPC_ERROR_NONE;
grpc_error_handle err;
grpc_core::RefCountedPtr<grpc_server_security_connector> sc;
int port_num = 0;
grpc_core::Server* core_server = grpc_core::Server::FromC(server);

@ -550,7 +550,7 @@ static void destroy_transport_locked(void* tp, grpc_error_handle /*error*/) {
static void destroy_transport(grpc_transport* gt) {
grpc_chttp2_transport* t = reinterpret_cast<grpc_chttp2_transport*>(gt);
t->combiner->Run(GRPC_CLOSURE_CREATE(destroy_transport_locked, t, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void close_transport_locked(grpc_chttp2_transport* t,
@ -694,7 +694,7 @@ grpc_chttp2_stream::~grpc_chttp2_stream() {
GPR_ASSERT(recv_trailing_metadata_finished == nullptr);
grpc_slice_buffer_destroy(&flow_controlled_buffer);
GRPC_CHTTP2_UNREF_TRANSPORT(t, "stream");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, destroy_stream_arg, absl::OkStatus());
}
static int init_stream(grpc_transport* gt, grpc_stream* gs,
@ -718,7 +718,7 @@ static void destroy_stream(grpc_transport* gt, grpc_stream* gs,
s->destroy_stream_arg = then_schedule_closure;
t->combiner->Run(
GRPC_CLOSURE_INIT(&s->destroy_stream, destroy_stream_locked, s, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
grpc_chttp2_stream* grpc_chttp2_parsing_accept_stream(grpc_chttp2_transport* t,
@ -768,7 +768,7 @@ static void set_write_state(grpc_chttp2_transport* t,
grpc_core::ExecCtx::RunList(DEBUG_LOCATION, &t->run_after_write);
if (!t->close_transport_on_writes_finished.ok()) {
grpc_error_handle err = t->close_transport_on_writes_finished;
t->close_transport_on_writes_finished = GRPC_ERROR_NONE;
t->close_transport_on_writes_finished = absl::OkStatus();
close_transport_locked(t, err);
}
}
@ -800,7 +800,7 @@ void grpc_chttp2_initiate_write(grpc_chttp2_transport* t,
t->combiner->FinallyRun(
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
write_action_begin_locked, t, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
break;
case GRPC_CHTTP2_WRITE_STATE_WRITING:
set_write_state(t, GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE,
@ -841,7 +841,7 @@ static void write_action_begin_locked(void* gt,
r.partial ? GRPC_CHTTP2_WRITE_STATE_WRITING_WITH_MORE
: GRPC_CHTTP2_WRITE_STATE_WRITING,
begin_writing_desc(r.partial));
write_action(t, GRPC_ERROR_NONE);
write_action(t, absl::OkStatus());
if (t->reading_paused_on_pending_induced_frames) {
GPR_ASSERT(t->num_pending_induced_frames == 0);
// We had paused reading, because we had many induced frames (SETTINGS
@ -929,7 +929,7 @@ static void write_action_end_locked(void* tp, grpc_error_handle error) {
t->combiner->FinallyRun(
GRPC_CLOSURE_INIT(&t->write_action_begin_locked,
write_action_begin_locked, t, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
break;
}
@ -1111,7 +1111,7 @@ static void null_then_sched_closure(grpc_closure** closure) {
// completion, have the application see it, and make a new operation on the
// call which recycles the batch BEFORE the call to start_batch completes,
// forcing a race.
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, c, absl::OkStatus());
}
void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
@ -1294,7 +1294,7 @@ static void perform_stream_op_locked(void* stream_op,
// started. The surface layer will notice that the stream has been closed
// for writes and fail the send message op.
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
GRPC_ERROR_NONE,
absl::OkStatus(),
"fetching_send_message_finished");
} else {
uint8_t* frame_hdr = grpc_slice_buffer_tiny_add(
@ -1329,7 +1329,7 @@ static void perform_stream_op_locked(void* stream_op,
int64_t notify_offset = s->next_message_end_offset;
if (notify_offset <= s->flow_controlled_bytes_written) {
grpc_chttp2_complete_closure_step(t, s, &s->send_message_finished,
GRPC_ERROR_NONE,
absl::OkStatus(),
"fetching_send_message_finished");
} else {
grpc_chttp2_write_cb* cb = t->write_cb_pool;
@ -1374,7 +1374,7 @@ static void perform_stream_op_locked(void* stream_op,
grpc_chttp2_complete_closure_step(
t, s, &s->send_trailing_metadata_finished,
op->payload->send_trailing_metadata.send_trailing_metadata->empty()
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Attempt to send trailing metadata after "
"stream was closed"),
@ -1427,7 +1427,7 @@ static void perform_stream_op_locked(void* stream_op,
}
if (on_complete != nullptr) {
grpc_chttp2_complete_closure_step(t, s, &on_complete, GRPC_ERROR_NONE,
grpc_chttp2_complete_closure_step(t, s, &on_complete, absl::OkStatus(),
"op->on_complete");
}
@ -1461,7 +1461,7 @@ static void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
op->handler_private.extra_arg = gs;
t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
perform_stream_op_locked, op, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void cancel_pings(grpc_chttp2_transport* t, grpc_error_handle error) {
@ -1484,9 +1484,9 @@ static void send_ping_locked(grpc_chttp2_transport* t,
}
grpc_chttp2_ping_queue* pq = &t->ping_queue;
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_INITIATE], on_initiate,
GRPC_ERROR_NONE);
absl::OkStatus());
grpc_closure_list_append(&pq->lists[GRPC_CHTTP2_PCL_NEXT], on_ack,
GRPC_ERROR_NONE);
absl::OkStatus());
}
// Specialized form of send_ping_locked for keepalive ping. If there is already
@ -1513,19 +1513,19 @@ static void send_keepalive_ping_locked(grpc_chttp2_transport* t) {
&pq->lists[GRPC_CHTTP2_PCL_INFLIGHT],
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked,
finish_keepalive_ping, t, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
absl::OkStatus());
return;
}
grpc_closure_list_append(
&pq->lists[GRPC_CHTTP2_PCL_INITIATE],
GRPC_CLOSURE_INIT(&t->start_keepalive_ping_locked, start_keepalive_ping,
t, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
absl::OkStatus());
grpc_closure_list_append(
&pq->lists[GRPC_CHTTP2_PCL_NEXT],
GRPC_CLOSURE_INIT(&t->finish_keepalive_ping_locked, finish_keepalive_ping,
t, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
absl::OkStatus());
}
void grpc_chttp2_retry_initiate_ping(void* tp, grpc_error_handle error) {
@ -1619,7 +1619,7 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
auto* self = static_cast<GracefulGoaway*>(arg);
self->t_->combiner->Run(
GRPC_CLOSURE_INIT(&self->on_ping_ack_, OnPingAckLocked, self, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void OnPingAckLocked(void* arg, grpc_error_handle /* error */) {
@ -1637,7 +1637,7 @@ class GracefulGoaway : public grpc_core::RefCounted<GracefulGoaway> {
}
self->t_->combiner->Run(
GRPC_CLOSURE_INIT(&self->on_timer_, OnTimerLocked, self, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void OnTimerLocked(void* arg, grpc_error_handle /* error */) {
@ -1750,7 +1750,7 @@ static void perform_transport_op_locked(void* stream_op,
close_transport_locked(t, op->disconnect_with_error);
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
GRPC_CHTTP2_UNREF_TRANSPORT(t, "transport_op");
}
@ -1765,7 +1765,7 @@ static void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
GRPC_CHTTP2_REF_TRANSPORT(t, "transport_op");
t->combiner->Run(GRPC_CLOSURE_INIT(&op->handler_private.closure,
perform_transport_op_locked, op, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
//
@ -1800,7 +1800,7 @@ void grpc_chttp2_maybe_complete_recv_message(grpc_chttp2_transport* t,
grpc_core::chttp2::StreamFlowControl::IncomingUpdateContext upd(
&s->flow_control);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
// Lambda is immediately invoked as a big scoped section that can be
// exited out of at any point by returning.
@ -1980,7 +1980,7 @@ static grpc_error_handle removal_error(grpc_error_handle extra_error,
add_error(s->read_closed_error, refs, &nrefs);
add_error(s->write_closed_error, refs, &nrefs);
add_error(extra_error, refs, &nrefs);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (nrefs > 0) {
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(main_error_msg,
refs, nrefs);
@ -2304,18 +2304,18 @@ void grpc_chttp2_act_on_flowctl_action(
static grpc_error_handle try_http_parsing(grpc_chttp2_transport* t) {
grpc_http_parser parser;
size_t i = 0;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
grpc_http_response response;
grpc_http_parser_init(&parser, GRPC_HTTP_RESPONSE, &response);
grpc_error_handle parse_error = GRPC_ERROR_NONE;
grpc_error_handle parse_error;
for (; i < t->read_buffer.count && parse_error.ok(); i++) {
parse_error =
grpc_http_parser_parse(&parser, t->read_buffer.slices[i], nullptr);
}
if (parse_error.ok() &&
(parse_error = grpc_http_parser_eof(&parser)) == GRPC_ERROR_NONE) {
(parse_error = grpc_http_parser_eof(&parser)) == absl::OkStatus()) {
error = grpc_error_set_int(
grpc_error_set_int(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Trying to connect an http1.x server"),
@ -2349,11 +2349,11 @@ static void read_action_locked(void* tp, grpc_error_handle error) {
std::swap(err, error);
if (t->closed_with_error.ok()) {
size_t i = 0;
grpc_error_handle errors[3] = {error, GRPC_ERROR_NONE, GRPC_ERROR_NONE};
for (; i < t->read_buffer.count && errors[1] == GRPC_ERROR_NONE; i++) {
grpc_error_handle errors[3] = {error, absl::OkStatus(), absl::OkStatus()};
for (; i < t->read_buffer.count && errors[1] == absl::OkStatus(); i++) {
errors[1] = grpc_chttp2_perform_read(t, t->read_buffer.slices[i]);
}
if (errors[1] != GRPC_ERROR_NONE) {
if (errors[1] != absl::OkStatus()) {
errors[2] = try_http_parsing(t);
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"Failed parsing HTTP/2", errors, GPR_ARRAY_SIZE(errors));
@ -2609,7 +2609,7 @@ static void init_keepalive_ping_locked(void* arg, grpc_error_handle error) {
grpc_core::Timestamp::Now() + t->keepalive_time,
&t->init_keepalive_ping_locked);
}
} else if (error == GRPC_ERROR_CANCELLED) {
} else if (error == absl::CancelledError()) {
// The keepalive ping timer may be cancelled by bdp
if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace) ||
GRPC_TRACE_FLAG_ENABLED(grpc_keepalive_trace)) {
@ -2717,7 +2717,7 @@ static void keepalive_watchdog_fired_locked(void* arg,
} else {
// The watchdog timer should have been cancelled by
// finish_keepalive_ping_locked.
if (GPR_UNLIKELY(error != GRPC_ERROR_CANCELLED)) {
if (GPR_UNLIKELY(error != absl::CancelledError())) {
gpr_log(GPR_ERROR, "keepalive_ping_end state error: %d (expect: %d)",
t->keepalive_state, GRPC_CHTTP2_KEEPALIVE_STATE_PINGING);
}
@ -2770,7 +2770,7 @@ static void post_benign_reclaimer(grpc_chttp2_transport* t) {
benign_reclaimer_locked, t,
grpc_schedule_on_exec_ctx);
t->active_reclamation = std::move(*sweep);
t->combiner->Run(&t->benign_reclaimer_locked, GRPC_ERROR_NONE);
t->combiner->Run(&t->benign_reclaimer_locked, absl::OkStatus());
} else {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
}
@ -2790,7 +2790,8 @@ static void post_destructive_reclaimer(grpc_chttp2_transport* t) {
destructive_reclaimer_locked, t,
grpc_schedule_on_exec_ctx);
t->active_reclamation = std::move(*sweep);
t->combiner->Run(&t->destructive_reclaimer_locked, GRPC_ERROR_NONE);
t->combiner->Run(&t->destructive_reclaimer_locked,
absl::OkStatus());
} else {
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
}
@ -2820,7 +2821,7 @@ static void benign_reclaimer_locked(void* arg, grpc_error_handle error) {
grpc_chttp2_stream_map_size(&t->stream_map));
}
t->benign_reclaimer_registered = false;
if (error != GRPC_ERROR_CANCELLED) {
if (error != absl::CancelledError()) {
t->active_reclamation.Finish();
}
GRPC_CHTTP2_UNREF_TRANSPORT(t, "benign_reclaimer");
@ -2850,7 +2851,7 @@ static void destructive_reclaimer_locked(void* arg, grpc_error_handle error) {
post_destructive_reclaimer(t);
}
}
if (error != GRPC_ERROR_CANCELLED) {
if (error != absl::CancelledError()) {
t->active_reclamation.Finish();
}
GRPC_CHTTP2_UNREF_TRANSPORT(t, "destructive_reclaimer");
@ -2958,5 +2959,5 @@ void grpc_chttp2_transport_start_reading(
t->notify_on_close = notify_on_close;
t->combiner->Run(
GRPC_CLOSURE_INIT(&t->read_action_locked, read_action_locked, t, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}

@ -82,7 +82,7 @@ grpc_core::Poll<grpc_error_handle> grpc_deframe_unprocessed_incoming_frames(
grpc_chttp2_stream* s, uint32_t* min_progress_size,
grpc_core::SliceBuffer* stream_out, uint32_t* message_flags) {
grpc_slice_buffer* slices = &s->frame_storage;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (slices->length < 5) {
if (min_progress_size != nullptr) *min_progress_size = 5 - slices->length;
@ -130,7 +130,7 @@ grpc_core::Poll<grpc_error_handle> grpc_deframe_unprocessed_incoming_frames(
grpc_slice_buffer_move_first(slices, length, stream_out->c_slice_buffer());
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_chttp2_data_parser_parse(void* /*parser*/,
@ -147,8 +147,8 @@ grpc_error_handle grpc_chttp2_data_parser_parse(void* /*parser*/,
t, s, true, false,
t->is_client ? GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Data frame with END_STREAM flag received")
: GRPC_ERROR_NONE);
: absl::OkStatus());
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}

@ -23,6 +23,7 @@
#include <string.h>
#include "absl/base/attributes.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
@ -52,7 +53,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_begin_frame(
p->debug_data = static_cast<char*>(gpr_malloc(p->debug_length));
p->debug_pos = 0;
p->state = GRPC_CHTTP2_GOAWAY_LSI0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
@ -70,7 +71,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_LSI0:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->last_stream_id = (static_cast<uint32_t>(*cur)) << 24;
++cur;
@ -78,7 +79,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_LSI1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI1;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
@ -86,7 +87,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_LSI2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI2;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->last_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
@ -94,7 +95,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_LSI3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_LSI3;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->last_stream_id |= (static_cast<uint32_t>(*cur));
++cur;
@ -102,7 +103,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_ERR0:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->error_code = (static_cast<uint32_t>(*cur)) << 24;
++cur;
@ -110,7 +111,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_ERR1:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR1;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 16;
++cur;
@ -118,7 +119,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_ERR2:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR2;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->error_code |= (static_cast<uint32_t>(*cur)) << 8;
++cur;
@ -126,7 +127,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
case GRPC_CHTTP2_GOAWAY_ERR3:
if (cur == end) {
p->state = GRPC_CHTTP2_GOAWAY_ERR3;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
p->error_code |= (static_cast<uint32_t>(*cur));
++cur;
@ -146,7 +147,7 @@ grpc_error_handle grpc_chttp2_goaway_parser_parse(void* parser,
gpr_free(p->debug_data);
p->debug_data = nullptr;
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
GPR_UNREACHABLE_CODE(
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Should never reach here"));

@ -24,6 +24,7 @@
#include <algorithm>
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include <grpc/support/alloc.h>
@ -69,7 +70,7 @@ grpc_error_handle grpc_chttp2_ping_parser_begin_frame(
parser->byte = 0;
parser->is_ack = flags;
parser->opaque_8bytes = 0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
@ -128,7 +129,7 @@ grpc_error_handle grpc_chttp2_ping_parser_parse(void* parser,
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void grpc_set_disable_ping_ack(bool disable_ping_ack) {

@ -22,6 +22,7 @@
#include <stddef.h>
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -79,7 +80,7 @@ grpc_error_handle grpc_chttp2_rst_stream_parser_begin_frame(
"invalid rst_stream: length=%d, flags=%02x", length, flags));
}
parser->byte = 0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser,
@ -111,7 +112,7 @@ grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser,
"[chttp2 transport=%p stream=%p] received RST_STREAM(reason=%d)",
t, s, reason);
}
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (reason != GRPC_HTTP2_NO_ERROR || s->trailing_metadata_buffer.empty()) {
error = grpc_error_set_int(
grpc_error_set_str(
@ -123,5 +124,5 @@ grpc_error_handle grpc_chttp2_rst_stream_parser_parse(void* parser,
grpc_chttp2_mark_stream_closed(t, s, true, true, error);
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}

@ -25,6 +25,7 @@
#include <string>
#include "absl/base/attributes.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include <grpc/slice_buffer.h>
@ -105,7 +106,7 @@ grpc_error_handle grpc_chttp2_settings_parser_begin_frame(
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"non-empty settings ack frame received");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else if (flags != 0) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"invalid flags on settings frame");
@ -113,7 +114,7 @@ grpc_error_handle grpc_chttp2_settings_parser_begin_frame(
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"settings frames must be a multiple of six bytes");
} else {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
}
@ -129,7 +130,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
grpc_chttp2_setting_id id;
if (parser->is_ack) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
for (;;) {
@ -147,11 +148,11 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
if (t->notify_on_receive_settings != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
t->notify_on_receive_settings,
GRPC_ERROR_NONE);
absl::OkStatus());
t->notify_on_receive_settings = nullptr;
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
parser->id = static_cast<uint16_t>((static_cast<uint16_t>(*cur)) << 8);
cur++;
@ -159,7 +160,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
case GRPC_CHTTP2_SPS_ID1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_ID1;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
parser->id = static_cast<uint16_t>(parser->id | (*cur));
cur++;
@ -167,7 +168,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
case GRPC_CHTTP2_SPS_VAL0:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
parser->value = (static_cast<uint32_t>(*cur)) << 24;
cur++;
@ -175,7 +176,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
case GRPC_CHTTP2_SPS_VAL1:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL1;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
parser->value |= (static_cast<uint32_t>(*cur)) << 16;
cur++;
@ -183,7 +184,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
case GRPC_CHTTP2_SPS_VAL2:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL2;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
parser->value |= (static_cast<uint32_t>(*cur)) << 8;
cur++;
@ -191,7 +192,7 @@ grpc_error_handle grpc_chttp2_settings_parser_parse(void* p,
case GRPC_CHTTP2_SPS_VAL3:
if (cur == end) {
parser->state = GRPC_CHTTP2_SPS_VAL3;
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else {
parser->state = GRPC_CHTTP2_SPS_ID0;
}

@ -22,6 +22,7 @@
#include <stddef.h>
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_format.h"
@ -64,7 +65,7 @@ grpc_error_handle grpc_chttp2_window_update_parser_begin_frame(
}
parser->byte = 0;
parser->amount = 0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_chttp2_window_update_parser_parse(
@ -117,5 +118,5 @@ grpc_error_handle grpc_chttp2_window_update_parser_parse(
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}

@ -586,7 +586,7 @@ class HPackParser::Input {
// Extract the parse error, leaving the current error as NONE.
grpc_error_handle TakeError() {
grpc_error_handle out = error_;
error_ = GRPC_ERROR_NONE;
error_ = absl::OkStatus();
return out;
}
@ -649,7 +649,7 @@ class HPackParser::Input {
// Frontier denotes the first byte past successfully processed input
const uint8_t* frontier_;
// Current error
grpc_error_handle error_ = GRPC_ERROR_NONE;
grpc_error_handle error_;
// If the error was EOF, we flag it here..
bool eof_error_ = false;
};
@ -1281,7 +1281,7 @@ grpc_error_handle HPackParser::Parse(const grpc_slice& slice, bool is_last) {
grpc_error_handle HPackParser::ParseInput(Input input, bool is_last) {
if (ParseInputInner(&input)) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
if (input.eof_error()) {
if (GPR_UNLIKELY(is_last && is_boundary())) {
@ -1289,7 +1289,7 @@ grpc_error_handle HPackParser::ParseInput(Input input, bool is_last) {
"Incomplete header at the end of a header/continuation sequence");
}
unparsed_bytes_ = std::vector<uint8_t>(input.frontier(), input.end_ptr());
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
return input.TakeError();
}
@ -1337,7 +1337,7 @@ static void force_client_rst_stream(void* sp, grpc_error_handle /*error*/) {
grpc_chttp2_add_rst_stream_to_next_write(t, s->id, GRPC_HTTP2_NO_ERROR,
&s->stats.outgoing);
grpc_chttp2_initiate_write(t, GRPC_CHTTP2_INITIATE_WRITE_FORCE_RST_STREAM);
grpc_chttp2_mark_stream_closed(t, s, true, true, GRPC_ERROR_NONE);
grpc_chttp2_mark_stream_closed(t, s, true, true, absl::OkStatus());
}
GRPC_CHTTP2_STREAM_UNREF(s, "final_rst");
}
@ -1378,12 +1378,12 @@ grpc_error_handle grpc_chttp2_header_parser_parse(void* hpack_parser,
GRPC_CHTTP2_STREAM_REF(s, "final_rst");
t->combiner->FinallyRun(
GRPC_CLOSURE_CREATE(force_client_rst_stream, s, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
grpc_chttp2_mark_stream_closed(t, s, true, false, GRPC_ERROR_NONE);
grpc_chttp2_mark_stream_closed(t, s, true, false, absl::OkStatus());
}
}
parser->FinishFrame();
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}

@ -27,6 +27,7 @@
#include <cstring>
#include <utility>
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
@ -100,7 +101,7 @@ void HPackTable::SetMaxBytes(uint32_t max_bytes) {
grpc_error_handle HPackTable::SetCurrentTableSize(uint32_t bytes) {
if (current_table_bytes_ == bytes) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
if (bytes > max_bytes_) {
return GRPC_ERROR_CREATE_FROM_CPP_STRING(absl::StrFormat(
@ -117,7 +118,7 @@ grpc_error_handle HPackTable::SetCurrentTableSize(uint32_t bytes) {
uint32_t new_cap = std::max(hpack_constants::EntriesForBytes(bytes),
hpack_constants::kInitialTableEntries);
entries_.Rebuild(new_cap);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle HPackTable::Add(Memento md) {
@ -140,7 +141,7 @@ grpc_error_handle HPackTable::Add(Memento md) {
while (entries_.num_entries()) {
EvictOne();
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
// evict entries to ensure no overflow
@ -152,7 +153,7 @@ grpc_error_handle HPackTable::Add(Memento md) {
// copy the finalized entry in
mem_used_ += md.transport_size();
entries_.Put(std::move(md));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
namespace {

@ -261,7 +261,7 @@ struct grpc_chttp2_transport {
/** is the transport destroying itself? */
uint8_t destroying = false;
/** has the upper layer closed the transport? */
grpc_error_handle closed_with_error = GRPC_ERROR_NONE;
grpc_error_handle closed_with_error;
/** is there a read request to the endpoint outstanding? */
uint8_t endpoint_reading = 1;
@ -309,8 +309,8 @@ struct grpc_chttp2_transport {
uint32_t write_buffer_size = grpc_core::chttp2::kDefaultWindow;
/** Set to a grpc_error object if a goaway frame is received. By default, set
* to GRPC_ERROR_NONE */
grpc_error_handle goaway_error = GRPC_ERROR_NONE;
* to absl::OkStatus() */
grpc_error_handle goaway_error;
grpc_chttp2_sent_goaway_state sent_goaway_state = GRPC_CHTTP2_NO_GOAWAY_SEND;
@ -391,7 +391,7 @@ struct grpc_chttp2_transport {
/* if non-NULL, close the transport with this error when writes are finished
*/
grpc_error_handle close_transport_on_writes_finished = GRPC_ERROR_NONE;
grpc_error_handle close_transport_on_writes_finished;
/* a list of closures to run after writes are finished */
grpc_closure_list run_after_write = GRPC_CLOSURE_LIST_INIT;
@ -527,9 +527,9 @@ struct grpc_chttp2_stream {
bool eos_sent = false;
/** the error that resulted in this stream being read-closed */
grpc_error_handle read_closed_error = GRPC_ERROR_NONE;
grpc_error_handle read_closed_error;
/** the error that resulted in this stream being write-closed */
grpc_error_handle write_closed_error = GRPC_ERROR_NONE;
grpc_error_handle write_closed_error;
grpc_published_metadata_method published_metadata[2] = {};
bool final_metadata_requested = false;
@ -543,7 +543,7 @@ struct grpc_chttp2_stream {
grpc_core::Timestamp deadline = grpc_core::Timestamp::InfFuture();
/** saw some stream level error */
grpc_error_handle forced_close_error = GRPC_ERROR_NONE;
grpc_error_handle forced_close_error;
/** how many header frames have we received? */
uint8_t header_frames_received = 0;
/** number of bytes received - reset at end of parse thread execution */

@ -130,7 +130,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
const uint8_t* cur = beg;
grpc_error_handle err;
if (cur == end) return GRPC_ERROR_NONE;
if (cur == end) return absl::OkStatus();
switch (t->deframe_state) {
case GRPC_DTS_CLIENT_PREFIX_0:
@ -175,7 +175,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
1 + static_cast<int>(t->deframe_state));
}
if (cur == end) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
dts_fh_0:
ABSL_FALLTHROUGH_INTENDED;
@ -184,7 +184,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size = (static_cast<uint32_t>(*cur)) << 16;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_1;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_1:
@ -192,7 +192,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size |= (static_cast<uint32_t>(*cur)) << 8;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_2;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_2:
@ -200,7 +200,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_size |= *cur;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_3;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_3:
@ -208,7 +208,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_type = *cur;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_4;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_4:
@ -216,7 +216,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_frame_flags = *cur;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_5;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_5:
@ -224,7 +224,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_stream_id = ((static_cast<uint32_t>(*cur)) & 0x7f) << 24;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_6;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_6:
@ -232,7 +232,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 16;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_7;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_7:
@ -240,7 +240,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_stream_id |= (static_cast<uint32_t>(*cur)) << 8;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_8;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FH_8:
@ -259,7 +259,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
t->incoming_stream = nullptr;
if (++cur == end) {
t->deframe_state = GRPC_DTS_FH_0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
goto dts_fh_0; /* loop */
} else if (t->incoming_frame_size >
@ -272,7 +272,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
[GRPC_CHTTP2_SETTINGS_MAX_FRAME_SIZE]));
}
if (++cur == end) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
ABSL_FALLTHROUGH_INTENDED;
case GRPC_DTS_FRAME:
@ -288,7 +288,7 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
}
t->deframe_state = GRPC_DTS_FH_0;
t->incoming_stream = nullptr;
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else if (static_cast<uint32_t>(end - cur) > t->incoming_frame_size) {
size_t cur_offset = static_cast<size_t>(cur - beg);
err = parse_frame_slice(
@ -312,12 +312,12 @@ grpc_error_handle grpc_chttp2_perform_read(grpc_chttp2_transport* t,
return err;
}
t->incoming_frame_size -= static_cast<uint32_t>(end - cur);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
GPR_UNREACHABLE_CODE(return absl::OkStatus());
}
GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
GPR_UNREACHABLE_CODE(return absl::OkStatus());
}
static grpc_error_handle init_frame_parser(grpc_chttp2_transport* t) {
@ -373,7 +373,7 @@ static grpc_error_handle skip_parser(void* /*parser*/,
grpc_chttp2_stream* /*s*/,
const grpc_slice& /*slice*/,
int /*is_last*/) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static HPackParser::Boundary hpack_boundary_type(grpc_chttp2_transport* t,
@ -409,13 +409,13 @@ static grpc_error_handle init_header_skip_frame_parser(
[GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE],
hpack_boundary_type(t, is_eoh), priority_type,
hpack_parser_log_info(t, HPackParser::LogInfo::kDontKnow));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle init_non_header_skip_frame_parser(
grpc_chttp2_transport* t) {
t->parser = skip_parser;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
void grpc_chttp2_parsing_become_skip_parser(grpc_chttp2_transport* t) {
@ -473,7 +473,7 @@ error_handler:
t->parser = grpc_chttp2_data_parser_parse;
t->parser_data = nullptr;
t->ping_state.last_ping_sent_time = grpc_core::Timestamp::InfPast();
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else if (s != nullptr) {
/* handle stream errors by closing the stream */
grpc_chttp2_mark_stream_closed(t, s, true, false,
@ -622,7 +622,7 @@ static grpc_error_handle init_header_frame_parser(grpc_chttp2_transport* t,
[GRPC_CHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE],
hpack_boundary_type(t, is_eoh), priority_type,
hpack_parser_log_info(t, frame_type));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle init_window_update_frame_parser(
@ -641,7 +641,7 @@ static grpc_error_handle init_window_update_frame_parser(
}
t->parser = grpc_chttp2_window_update_parser_parse;
t->parser_data = &t->simple.window_update;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle init_ping_parser(grpc_chttp2_transport* t) {
@ -650,7 +650,7 @@ static grpc_error_handle init_ping_parser(grpc_chttp2_transport* t) {
if (!err.ok()) return err;
t->parser = grpc_chttp2_ping_parser_parse;
t->parser_data = &t->simple.ping;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle init_rst_stream_parser(grpc_chttp2_transport* t) {
@ -665,7 +665,7 @@ static grpc_error_handle init_rst_stream_parser(grpc_chttp2_transport* t) {
s->stats.incoming.framing_bytes += 9;
t->parser = grpc_chttp2_rst_stream_parser_parse;
t->parser_data = &t->simple.rst_stream;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle init_goaway_parser(grpc_chttp2_transport* t) {
@ -674,7 +674,7 @@ static grpc_error_handle init_goaway_parser(grpc_chttp2_transport* t) {
if (!err.ok()) return err;
t->parser = grpc_chttp2_goaway_parser_parse;
t->parser_data = &t->goaway_parser;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle init_settings_frame_parser(grpc_chttp2_transport* t) {
@ -702,7 +702,7 @@ static grpc_error_handle init_settings_frame_parser(grpc_chttp2_transport* t) {
}
t->parser = grpc_chttp2_settings_parser_parse;
t->parser_data = &t->simple.settings;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle parse_frame_slice(grpc_chttp2_transport* t,

@ -24,6 +24,7 @@
#include <algorithm>
#include <string>
#include "absl/status/status.h"
#include "absl/types/optional.h"
#include <grpc/slice.h>
@ -410,7 +411,7 @@ class DataSendContext {
t_, s_,
static_cast<int64_t>(s_->sending_bytes - sending_bytes_before_),
&s_->on_flow_controlled_cbs, &s_->flow_controlled_bytes_flowed,
GRPC_ERROR_NONE)) {
absl::OkStatus())) {
write_context_->NoteScheduledResults();
}
}
@ -472,7 +473,7 @@ class StreamWriteContext {
s_->sent_initial_metadata = true;
write_context_->NoteScheduledResults();
grpc_chttp2_complete_closure_step(
t_, s_, &s_->send_initial_metadata_finished, GRPC_ERROR_NONE,
t_, s_, &s_->send_initial_metadata_finished, absl::OkStatus(),
"send_initial_metadata_finished");
}
@ -566,7 +567,7 @@ class StreamWriteContext {
write_context_->NoteScheduledResults();
grpc_chttp2_complete_closure_step(
t_, s_, &s_->send_trailing_metadata_finished, GRPC_ERROR_NONE,
t_, s_, &s_->send_trailing_metadata_finished, absl::OkStatus(),
"send_trailing_metadata_finished");
}
@ -599,7 +600,7 @@ class StreamWriteContext {
s_->id, GRPC_HTTP2_NO_ERROR, &s_->stats.outgoing));
}
grpc_chttp2_mark_stream_closed(t_, s_, !t_->is_client, true,
GRPC_ERROR_NONE);
absl::OkStatus());
}
WriteContext* const write_context_;

@ -28,6 +28,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"
@ -173,7 +174,7 @@ struct op_state {
/* User requested RECV_TRAILING_METADATA */
bool pending_recv_trailing_metadata = false;
cronet_net_error_code net_error = OK;
grpc_error_handle cancel_error = GRPC_ERROR_NONE;
grpc_error_handle cancel_error;
/* data structure for storing data coming from server */
struct read_state rs;
/* data structure for storing data going to the server */
@ -1139,24 +1140,24 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
stream_op->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
} else if (stream_state->state_callback_received[OP_FAILED]) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
stream_op->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
} else if (stream_state->state_op_done[OP_RECV_TRAILING_METADATA]) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
stream_op->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
} else {
*stream_op->payload->recv_initial_metadata.recv_initial_metadata =
std::move(oas->s->state.rs.initial_metadata);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
stream_op->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
}
stream_state->state_op_done[OP_RECV_INITIAL_METADATA] = true;
result = ACTION_TAKEN_NO_CALLBACK;
@ -1167,7 +1168,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
CRONET_LOG(GPR_DEBUG, "Stream is cancelled.");
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, stream_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
stream_state->state_op_done[OP_RECV_MESSAGE] = true;
oas->state.state_op_done[OP_RECV_MESSAGE] = true;
result = ACTION_TAKEN_NO_CALLBACK;
@ -1175,7 +1176,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
CRONET_LOG(GPR_DEBUG, "Stream failed.");
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, stream_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
stream_state->state_op_done[OP_RECV_MESSAGE] = true;
oas->state.state_op_done[OP_RECV_MESSAGE] = true;
result = ACTION_TAKEN_NO_CALLBACK;
@ -1184,7 +1185,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
CRONET_LOG(GPR_DEBUG, "read stream closed");
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, stream_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
stream_state->state_op_done[OP_RECV_MESSAGE] = true;
oas->state.state_op_done[OP_RECV_MESSAGE] = true;
result = ACTION_TAKEN_NO_CALLBACK;
@ -1192,7 +1193,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
CRONET_LOG(GPR_DEBUG, "flush read");
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, stream_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
stream_state->state_op_done[OP_RECV_MESSAGE] = true;
oas->state.state_op_done[OP_RECV_MESSAGE] = true;
result = ACTION_TAKEN_NO_CALLBACK;
@ -1233,7 +1234,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
stream_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
stream_state->state_op_done[OP_RECV_MESSAGE] = true;
oas->state.state_op_done[OP_RECV_MESSAGE] = true;
@ -1280,7 +1281,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
std::move(stream_state->rs.read_slice_buffer);
grpc_core::ExecCtx::Run(
DEBUG_LOCATION, stream_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
stream_state->state_op_done[OP_RECV_MESSAGE] = true;
oas->state.state_op_done[OP_RECV_MESSAGE] = true;
/* Do an extra read to trigger on_succeeded() callback in case connection
@ -1293,7 +1294,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
op_can_be_run(stream_op, s, &oas->state,
OP_RECV_TRAILING_METADATA)) {
CRONET_LOG(GPR_DEBUG, "running: %p OP_RECV_TRAILING_METADATA", oas);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (stream_state->state_op_done[OP_CANCEL_ERROR]) {
error = stream_state->cancel_error;
} else if (stream_state->state_callback_received[OP_FAILED]) {
@ -1352,7 +1353,7 @@ static enum e_op_result execute_stream_op(struct op_and_state* oas) {
*/
if (stream_op->on_complete) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, stream_op->on_complete,
GRPC_ERROR_NONE);
absl::OkStatus());
}
}
oas->state.state_op_done[OP_ON_COMPLETE] = true;
@ -1419,21 +1420,21 @@ static void perform_stream_op(grpc_transport* /*gt*/, grpc_stream* gs,
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
op->payload->recv_initial_metadata.recv_initial_metadata_ready,
GRPC_ERROR_CANCELLED);
absl::CancelledError());
}
if (op->recv_message) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
op->payload->recv_message.recv_message_ready,
GRPC_ERROR_CANCELLED);
absl::CancelledError());
}
if (op->recv_trailing_metadata) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
op->payload->recv_trailing_metadata.recv_trailing_metadata_ready,
GRPC_ERROR_CANCELLED);
absl::CancelledError());
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_complete,
GRPC_ERROR_CANCELLED);
absl::CancelledError());
return;
}
stream_obj* s = reinterpret_cast<stream_obj*>(gs);
@ -1446,7 +1447,7 @@ static void destroy_stream(grpc_transport* /*gt*/, grpc_stream* gs,
stream_obj* s = reinterpret_cast<stream_obj*>(gs);
s->~stream_obj();
grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure,
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void destroy_transport(grpc_transport* /*gt*/) {}

@ -205,7 +205,7 @@ struct inproc_stream {
}
if (!cs->write_buffer_cancel_error.ok()) {
cancel_other_error = cs->write_buffer_cancel_error;
cs->write_buffer_cancel_error = GRPC_ERROR_NONE;
cs->write_buffer_cancel_error = absl::OkStatus();
maybe_process_ops_locked(this, cancel_other_error);
}
@ -251,7 +251,7 @@ struct inproc_stream {
grpc_core::Timestamp::InfFuture();
grpc_metadata_batch write_buffer_trailing_md{arena};
bool write_buffer_trailing_md_filled = false;
grpc_error_handle write_buffer_cancel_error = GRPC_ERROR_NONE;
grpc_error_handle write_buffer_cancel_error;
struct inproc_stream* other_side;
bool other_side_closed = false; // won't talk anymore
@ -275,8 +275,8 @@ struct inproc_stream {
bool closed = false;
grpc_error_handle cancel_self_error = GRPC_ERROR_NONE;
grpc_error_handle cancel_other_error = GRPC_ERROR_NONE;
grpc_error_handle cancel_self_error;
grpc_error_handle cancel_other_error;
grpc_core::Timestamp deadline = grpc_core::Timestamp::InfFuture();
@ -461,7 +461,7 @@ void fail_helper_locked(inproc_stream* s, grpc_error_handle error) {
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata,
nullptr);
err = GRPC_ERROR_NONE;
err = absl::OkStatus();
} else {
err = error;
}
@ -556,12 +556,12 @@ void message_transfer_locked(inproc_stream* sender, inproc_stream* receiver) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
receiver->recv_message_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
complete_if_batch_end_locked(
sender, GRPC_ERROR_NONE, sender->send_message_op,
sender, absl::OkStatus(), sender->send_message_op,
"message_transfer scheduling sender on_complete");
complete_if_batch_end_locked(
receiver, GRPC_ERROR_NONE, receiver->recv_message_op,
receiver, absl::OkStatus(), receiver->recv_message_op,
"message_transfer scheduling receiver on_complete");
receiver->recv_message_op = nullptr;
@ -574,7 +574,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
// Schedule our appropriate closures
// and then return to ops_needed state if still needed
grpc_error_handle new_err = GRPC_ERROR_NONE;
grpc_error_handle new_err;
bool needs_close = false;
@ -596,12 +596,12 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
if (s->send_message_op && other) {
if (other->recv_message_op) {
message_transfer_locked(s, other);
maybe_process_ops_locked(other, GRPC_ERROR_NONE);
maybe_process_ops_locked(other, absl::OkStatus());
} else if (!s->t->is_client && s->trailing_md_sent) {
// A server send will never be matched if the server already sent status
ResetSendMessage(s->send_message_op);
complete_if_batch_end_locked(
s, GRPC_ERROR_NONE, s->send_message_op,
s, absl::OkStatus(), s->send_message_op,
"op_state_machine scheduling send-message-on-complete case 1");
s->send_message_op = nullptr;
}
@ -647,19 +647,19 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
.recv_trailing_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
INPROC_LOG(GPR_INFO,
"op_state_machine %p scheduling trailing-md-on-complete", s);
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
s->recv_trailing_md_op->on_complete,
GRPC_ERROR_NONE);
absl::OkStatus());
s->recv_trailing_md_op = nullptr;
needs_close = true;
}
}
maybe_process_ops_locked(other, GRPC_ERROR_NONE);
maybe_process_ops_locked(other, absl::OkStatus());
complete_if_batch_end_locked(
s, GRPC_ERROR_NONE, s->send_trailing_md_op,
s, absl::OkStatus(), s->send_trailing_md_op,
"op_state_machine scheduling send-trailing-metadata-on-complete");
s->send_trailing_md_op = nullptr;
}
@ -699,9 +699,9 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
DEBUG_LOCATION,
s->recv_initial_md_op->payload->recv_initial_metadata
.recv_initial_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
complete_if_batch_end_locked(
s, GRPC_ERROR_NONE, s->recv_initial_md_op,
s, absl::OkStatus(), s->recv_initial_md_op,
"op_state_machine scheduling recv-initial-metadata-on-complete");
s->recv_initial_md_op = nullptr;
}
@ -709,7 +709,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
if (s->recv_message_op) {
if (other && other->send_message_op) {
message_transfer_locked(other, s);
maybe_process_ops_locked(other, GRPC_ERROR_NONE);
maybe_process_ops_locked(other, absl::OkStatus());
}
}
if (s->to_read_trailing_md_filled) {
@ -742,7 +742,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_message_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
complete_if_batch_end_locked(
s, new_err, s->recv_message_op,
"op_state_machine scheduling recv-message-on-complete");
@ -779,10 +779,10 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
DEBUG_LOCATION,
s->recv_trailing_md_op->payload->recv_trailing_metadata
.recv_trailing_metadata_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
grpc_core::ExecCtx::Run(DEBUG_LOCATION,
s->recv_trailing_md_op->on_complete,
GRPC_ERROR_NONE);
absl::OkStatus());
s->recv_trailing_md_op = nullptr;
needs_close = s->trailing_md_sent;
}
@ -821,7 +821,7 @@ void op_state_machine_locked(inproc_stream* s, grpc_error_handle error) {
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
s->recv_message_op->payload->recv_message.recv_message_ready,
GRPC_ERROR_NONE);
absl::OkStatus());
complete_if_batch_end_locked(
s, new_err, s->recv_message_op,
"op_state_machine scheduling recv-message-on-complete");
@ -926,7 +926,7 @@ void perform_stream_op(grpc_transport* gt, grpc_stream* gs,
s->t->is_client, false);
}
}
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
grpc_closure* on_complete = op->on_complete;
// TODO(roth): This is a hack needed because we use data inside of the
// closure itself to do the barrier calculation (i.e., to ensure that
@ -1122,7 +1122,7 @@ void perform_transport_op(grpc_transport* gt, grpc_transport_op* op) {
t->accept_stream_data = op->set_accept_stream_user_data;
}
if (op->on_consumed) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, op->on_consumed, absl::OkStatus());
}
bool do_close = false;
@ -1149,7 +1149,7 @@ void destroy_stream(grpc_transport* gt, grpc_stream* gs,
gpr_mu_unlock(&t->mu->mu);
s->~inproc_stream();
grpc_core::ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure,
GRPC_ERROR_NONE);
absl::OkStatus());
}
void destroy_transport(grpc_transport* gt) {

@ -74,7 +74,7 @@ void CertificateProviderStore::PluginDefinition::JsonPostLoad(
}
if (factory == nullptr) return;
// Use plugin to validate and parse config.
grpc_error_handle parse_error = GRPC_ERROR_NONE;
grpc_error_handle parse_error;
config =
factory->CreateCertificateProviderConfig(config_json, &parse_error);
if (!parse_error.ok()) {

@ -205,7 +205,7 @@ void SetXdsFallbackBootstrapConfig(const char* config) {
grpc_slice grpc_dump_xds_configs(void) {
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
auto xds_client = grpc_core::GrpcXdsClient::GetOrCreate(
grpc_core::ChannelArgs(), "grpc_dump_xds_configs()");
if (!xds_client.ok()) {

@ -71,7 +71,6 @@
#include "src/core/lib/gprpp/env.h"
#include "src/core/lib/gprpp/match.h"
#include "src/core/lib/gprpp/time.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/matchers/matchers.h"
namespace grpc_core {
@ -581,7 +580,7 @@ absl::Status RouteRuntimeFractionParse(
route->matchers.fraction_per_million = numerator;
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
template <typename ParentType, typename EntryType>

@ -91,7 +91,7 @@ grpc_error_handle UnixSockaddrPopulate(absl::string_view path,
path.copy(un->sun_path, path.size());
un->sun_path[path.size()] = '\0';
resolved_addr->len = static_cast<socklen_t>(sizeof(*un));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle UnixAbstractSockaddrPopulate(
@ -109,7 +109,7 @@ grpc_error_handle UnixAbstractSockaddrPopulate(
path.copy(un->sun_path + 1, path.size());
resolved_addr->len =
static_cast<socklen_t>(sizeof(un->sun_family) + path.size() + 1);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
} // namespace grpc_core

@ -134,7 +134,7 @@ grpc_error_handle grpc_channel_stack_init(
sizeof(grpc_channel_element));
/* init per-filter data */
grpc_error_handle first_error = GRPC_ERROR_NONE;
grpc_error_handle first_error;
auto c_channel_args = channel_args.ToC();
for (i = 0; i < filter_count; i++) {
args.channel_stack = stack;
@ -194,7 +194,7 @@ grpc_error_handle grpc_call_stack_init(
GPR_ROUND_UP_TO_ALIGNMENT_SIZE(count * sizeof(grpc_call_element));
/* init per-filter data */
grpc_error_handle first_error = GRPC_ERROR_NONE;
grpc_error_handle first_error;
for (size_t i = 0; i < count; i++) {
call_elems[i].filter = channel_elems[i].filter;
call_elems[i].channel_data = channel_elems[i].channel_data;

@ -20,6 +20,8 @@
#include "src/core/lib/channel/connected_channel.h"
#include "absl/status/status.h"
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -156,7 +158,7 @@ static grpc_error_handle connected_channel_init_call_elem(
int r = grpc_transport_init_stream(
chand->transport, TRANSPORT_STREAM_FROM_CALL_DATA(calld),
&args->call_stack->refcount, args->server_transport_data, args->arena);
return r == 0 ? GRPC_ERROR_NONE
return r == 0 ? absl::OkStatus()
: GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"transport stream initialization failed");
}
@ -187,7 +189,7 @@ static grpc_error_handle connected_channel_init_channel_elem(
GPR_ASSERT(args->is_last);
cd->transport = grpc_channel_args_find_pointer<grpc_transport>(
args->channel_args, GRPC_ARG_TRANSPORT);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* Destructor for channel_data */

@ -75,7 +75,7 @@ void BaseCallData::Wakeup() {
self->Drop();
};
auto* closure = GRPC_CLOSURE_CREATE(wakeup, this, nullptr);
GRPC_CALL_COMBINER_START(call_combiner_, closure, GRPC_ERROR_NONE, "wakeup");
GRPC_CALL_COMBINER_START(call_combiner_, closure, absl::OkStatus(), "wakeup");
}
void BaseCallData::Drop() { GRPC_CALL_STACK_UNREF(call_stack_, "waker"); }
@ -196,7 +196,7 @@ BaseCallData::Flusher::~Flusher() {
GRPC_CLOSURE_INIT(&batch->handler_private.closure, call_next_op, batch,
nullptr);
GRPC_CALL_STACK_REF(call_->call_stack(), "flusher_batch");
call_closures_.Add(&batch->handler_private.closure, GRPC_ERROR_NONE,
call_closures_.Add(&batch->handler_private.closure, absl::OkStatus(),
"flusher_batch");
}
call_closures_.RunClosuresWithoutYielding(call_->call_combiner());
@ -282,7 +282,7 @@ class ClientCallData::PollContext {
flusher_->AddClosure(
std::exchange(self_->recv_initial_metadata_->original_on_ready,
nullptr),
GRPC_ERROR_NONE,
absl::OkStatus(),
"wake_inside_combiner:recv_initial_metadata_ready");
}
} break;
@ -310,7 +310,7 @@ class ClientCallData::PollContext {
flusher_->AddClosure(
std::exchange(self_->original_recv_trailing_metadata_ready_,
nullptr),
GRPC_ERROR_NONE, "wake_inside_combiner:recv_trailing_ready:1");
absl::OkStatus(), "wake_inside_combiner:recv_trailing_ready:1");
if (self_->recv_initial_metadata_ != nullptr) {
switch (self_->recv_initial_metadata_->state) {
case RecvInitialMetadata::kInitial:
@ -335,7 +335,7 @@ class ClientCallData::PollContext {
std::exchange(
self_->recv_initial_metadata_->original_on_ready,
nullptr),
GRPC_ERROR_CANCELLED,
absl::CancelledError(),
"wake_inside_combiner:recv_initial_metadata_ready");
}
}
@ -418,7 +418,7 @@ class ClientCallData::PollContext {
flusher_->AddClosure(
std::exchange(self_->original_recv_trailing_metadata_ready_,
nullptr),
GRPC_ERROR_NONE, "wake_inside_combiner:recv_trailing_ready:2");
absl::OkStatus(), "wake_inside_combiner:recv_trailing_ready:2");
}
break;
}
@ -448,7 +448,7 @@ class ClientCallData::PollContext {
p->call_data = self_;
GRPC_CALL_STACK_REF(self_->call_stack(), "re-poll");
GRPC_CLOSURE_INIT(p, run, p, nullptr);
flusher_->AddClosure(p, GRPC_ERROR_NONE, "re-poll");
flusher_->AddClosure(p, absl::OkStatus(), "re-poll");
}
}
@ -590,7 +590,7 @@ void ClientCallData::StartBatch(grpc_transport_stream_op_batch* b) {
if (!is_last()) {
batch.ResumeWith(&flusher);
} else {
batch.CancelWith(GRPC_ERROR_CANCELLED, &flusher);
batch.CancelWith(absl::CancelledError(), &flusher);
}
}
}
@ -915,7 +915,7 @@ class ServerCallData::PollContext {
p->call_data = self_;
GRPC_CALL_STACK_REF(self_->call_stack(), "re-poll");
GRPC_CLOSURE_INIT(p, run, p, nullptr);
flusher_->AddClosure(p, GRPC_ERROR_NONE, "re-poll");
flusher_->AddClosure(p, absl::OkStatus(), "re-poll");
}
}
@ -1163,7 +1163,7 @@ void ServerCallData::RecvInitialMetadataReady(grpc_error_handle error) {
WakeInsideCombiner(&flusher);
if (auto* closure =
std::exchange(original_recv_initial_metadata_ready_, nullptr)) {
flusher.AddClosure(closure, GRPC_ERROR_NONE,
flusher.AddClosure(closure, absl::OkStatus(),
"original_recv_initial_metadata");
}
}

@ -30,6 +30,7 @@
#include "absl/container/inlined_vector.h"
#include "absl/meta/type_traits.h"
#include "absl/status/status.h"
#include <grpc/impl/codegen/grpc_types.h>
#include <grpc/support/log.h>
@ -181,7 +182,7 @@ class BaseCallData : public Activity, private Wakeable {
}
void Complete(grpc_transport_stream_op_batch* batch) {
call_closures_.Add(batch->on_complete, GRPC_ERROR_NONE,
call_closures_.Add(batch->on_complete, absl::OkStatus(),
"Flusher::Complete");
}
@ -360,7 +361,7 @@ class ClientCallData : public BaseCallData {
// Our closure pointing to RecvTrailingMetadataReadyCallback.
grpc_closure recv_trailing_metadata_ready_;
// Error received during cancellation.
grpc_error_handle cancelled_error_ = GRPC_ERROR_NONE;
grpc_error_handle cancelled_error_;
// State of the send_initial_metadata op.
SendInitialState send_initial_state_ = SendInitialState::kInitial;
// State of the recv_trailing_metadata op.
@ -439,7 +440,7 @@ class ServerCallData : public BaseCallData {
// Our closure pointing to RecvInitialMetadataReadyCallback.
grpc_closure recv_initial_metadata_ready_;
// Error received during cancellation.
grpc_error_handle cancelled_error_ = GRPC_ERROR_NONE;
grpc_error_handle cancelled_error_;
// Trailing metadata batch
CapturedBatch send_trailing_metadata_batch_;
// State of the send_initial_metadata op.
@ -510,7 +511,7 @@ MakePromiseBasedFilter(const char* name) {
// init_call_elem
[](grpc_call_element* elem, const grpc_call_element_args* args) {
new (elem->call_data) CallData(elem, args, kFlags);
return GRPC_ERROR_NONE;
return absl::OkStatus();
},
// set_pollset_or_pollset_set
[](grpc_call_element* elem, grpc_polling_entity* pollent) {
@ -523,7 +524,7 @@ MakePromiseBasedFilter(const char* name) {
cd->Finalize(final_info);
cd->~CallData();
if ((kFlags & kFilterIsLast) != 0) {
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, absl::OkStatus());
} else {
GPR_ASSERT(then_schedule_closure == nullptr);
}
@ -544,7 +545,7 @@ MakePromiseBasedFilter(const char* name) {
return absl_status_to_grpc_error(status.status());
}
new (elem->channel_data) F(std::move(*status));
return GRPC_ERROR_NONE;
return absl::OkStatus();
},
// post_init_channel_elem
[](grpc_channel_stack*, grpc_channel_element* elem) {

@ -78,12 +78,12 @@ class TimerList {
TimerList& operator=(const TimerList&) = delete;
/* Initialize *timer. When expired or canceled, closure will be called with
error set to indicate if it expired (GRPC_ERROR_NONE) or was canceled
(GRPC_ERROR_CANCELLED). *closure is guaranteed to be called exactly once, and
application code should check the error to determine how it was invoked. The
application callback is also responsible for maintaining information about
when to free up any user-level state. Behavior is undefined for a deadline of
grpc_core::Timestamp::InfFuture(). */
error set to indicate if it expired (absl::OkStatus()) or was canceled
(absl::CancelledError()). *closure is guaranteed to be called exactly once,
and application code should check the error to determine how it was invoked.
The application callback is also responsible for maintaining information
about when to free up any user-level state. Behavior is undefined for a
deadline of grpc_core::Timestamp::InfFuture(). */
void TimerInit(Timer* timer, grpc_core::Timestamp deadline,
experimental::EventEngine::Closure* closure);
@ -103,8 +103,9 @@ class TimerList {
In all of these cases, the cancellation is still considered successful.
They are essentially distinguished in that the timer_cb will be run
exactly once from either the cancellation (with error GRPC_ERROR_CANCELLED)
or from the activation (with error GRPC_ERROR_NONE).
exactly once from either the cancellation (with error
absl::CancelledError()) or from the activation (with error
absl::OkStatus()).
Note carefully that the callback function MAY occur in the same callstack
as grpc_timer_cancel. It's expected that most timers will be cancelled

@ -151,7 +151,7 @@ grpc_error_handle grpc_tcp_set_non_block(SOCKET sock) {
status = WSAIoctl(sock, GRPC_FIONBIO, &param, sizeof(param), NULL, 0, &ret,
NULL, NULL);
return status == 0
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_WSA_ERROR(WSAGetLastError(), "WSAIoctl(GRPC_FIONBIO)");
}
@ -161,7 +161,7 @@ static grpc_error_handle set_dualstack(SOCKET sock) {
status = setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&param,
sizeof(param));
return status == 0
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)");
}
@ -173,7 +173,7 @@ static grpc_error_handle enable_socket_low_latency(SOCKET sock) {
if (status == SOCKET_ERROR) {
status = WSAGetLastError();
}
return status == 0 ? GRPC_ERROR_NONE
return status == 0 ? absl::OkStatus()
: GRPC_WSA_ERROR(status, "setsockopt(TCP_NODELAY)");
}
@ -187,7 +187,7 @@ absl::Status PrepareSocket(SOCKET sock) {
if (!err.ok()) return err;
err = set_dualstack(sock);
if (!err.ok()) return err;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
} // namespace experimental

@ -388,7 +388,7 @@ void HttpRequest::OnResolved(
}
addresses_ = std::move(*addresses_or);
next_address_ = 0;
NextAddress(GRPC_ERROR_NONE);
NextAddress(absl::OkStatus());
}
} // namespace grpc_core

@ -27,6 +27,7 @@
#include <vector>
#include "absl/base/thread_annotations.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/optional.h"
@ -259,7 +260,7 @@ class HttpRequest : public InternallyRefCounted<HttpRequest> {
grpc_iomgr_object iomgr_obj_ ABSL_GUARDED_BY(mu_);
grpc_slice_buffer incoming_ ABSL_GUARDED_BY(mu_);
grpc_slice_buffer outgoing_ ABSL_GUARDED_BY(mu_);
grpc_error_handle overall_error_ ABSL_GUARDED_BY(mu_) = GRPC_ERROR_NONE;
grpc_error_handle overall_error_ ABSL_GUARDED_BY(mu_) = absl::OkStatus();
absl::optional<DNSResolver::TaskHandle> dns_request_handle_
ABSL_GUARDED_BY(mu_) = DNSResolver::kNullHandle;
};

@ -109,7 +109,7 @@ class grpc_httpcli_ssl_channel_security_connector final
const ChannelArgs& /*args*/,
RefCountedPtr<grpc_auth_context>* /*auth_context*/,
grpc_closure* on_peer_checked) override {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
/* Check the peer name. */
if (secure_peer_name_ != nullptr &&

@ -24,6 +24,8 @@
#include <algorithm>
#include "absl/status/status.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
@ -86,7 +88,7 @@ static grpc_error_handle handle_response_line(grpc_http_parser* parser) {
/* we don't really care about the status code message */
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle handle_request_line(grpc_http_parser* parser) {
@ -157,7 +159,7 @@ static grpc_error_handle handle_request_line(grpc_http_parser* parser) {
"Expected one of HTTP/1.0, HTTP/1.1, or HTTP/2.0");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle handle_first_line(grpc_http_parser* parser) {
@ -179,7 +181,7 @@ static grpc_error_handle add_header(grpc_http_parser* parser) {
size_t size = 0;
grpc_http_header** hdrs = nullptr;
grpc_http_header hdr = {nullptr, nullptr};
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
GPR_ASSERT(cur != end);
@ -275,7 +277,7 @@ static grpc_error_handle finish_line(grpc_http_parser* parser,
}
parser->cur_line_length = 0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
@ -301,7 +303,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Expected chunk size in hexadecimal");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
case GRPC_HTTP_CHUNKED_IGNORE_ALL_UNTIL_LF:
if (byte == '\n') {
if (parser->http.response->chunk_length == 0) {
@ -310,7 +312,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_BODY;
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
case GRPC_HTTP_CHUNKED_BODY:
if (parser->http.response->chunk_length == 0) {
if (byte != '\r') {
@ -319,7 +321,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
}
parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_CONSUME_LF;
parser->http.response->chunk_length = 0;
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else {
parser->http.response->chunk_length--;
/* fallback to the normal body appending code below */
@ -331,7 +333,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
"Expected '\\r\\n' after chunk body");
}
parser->http.response->chunked_state = GRPC_HTTP_CHUNKED_LENGTH;
return GRPC_ERROR_NONE;
return absl::OkStatus();
case GRPC_HTTP_CHUNKED_PLAIN:
/* avoiding warning; just fallback to normal codepath */
break;
@ -353,7 +355,7 @@ static grpc_error_handle addbyte_body(grpc_http_parser* parser, uint8_t byte) {
(*body)[*body_length] = static_cast<char>(byte);
(*body_length)++;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static bool check_line(grpc_http_parser* parser) {
@ -399,13 +401,13 @@ static grpc_error_handle addbyte(grpc_http_parser* parser, uint8_t byte,
if (check_line(parser)) {
return finish_line(parser, found_body_start);
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
case GRPC_HTTP_BODY:
return addbyte_body(parser, byte);
case GRPC_HTTP_END:
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Unexpected byte after end");
}
GPR_UNREACHABLE_CODE(return GRPC_ERROR_NONE);
GPR_UNREACHABLE_CODE(return absl::OkStatus());
}
void grpc_http_parser_init(grpc_http_parser* parser, grpc_http_type type,
@ -451,12 +453,12 @@ grpc_error_handle grpc_http_parser_parse(grpc_http_parser* parser,
if (!err.ok()) return err;
if (found_body_start && start_of_body != nullptr) *start_of_body = i + 1;
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_http_parser_eof(grpc_http_parser* parser) {
if ((parser->state != GRPC_HTTP_BODY) && (parser->state != GRPC_HTTP_END)) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Did not finish headers");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}

@ -254,7 +254,7 @@ void TracedBuffer::ProcessTimestamp(TracedBuffer** head,
/* Got all timestamps. Do the callback and free this TracedBuffer.
* The thing below can be passed by value if we don't want the
* restriction on the lifetime. */
timestamps_callback(elem->arg_, &(elem->ts_), GRPC_ERROR_NONE);
timestamps_callback(elem->arg_, &(elem->ts_), absl::OkStatus());
next = elem->next_;
delete static_cast<TracedBuffer*>(elem);
*head = elem = next;

@ -39,7 +39,7 @@ grpc_error_handle DecodeCancelStateError(gpr_atm cancel_state) {
if (cancel_state & kErrorBit) {
return internal::StatusGetFromHeapPtr(cancel_state & ~kErrorBit);
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
} // namespace
@ -209,7 +209,7 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) {
this, closure);
}
// If we replaced an earlier closure, invoke the original
// closure with GRPC_ERROR_NONE. This allows callers to clean
// closure with absl::OkStatus(). This allows callers to clean
// up any resources they may be holding for the callback.
if (original_state != 0) {
closure = reinterpret_cast<grpc_closure*>(original_state);
@ -218,7 +218,7 @@ void CallCombiner::SetNotifyOnCancel(grpc_closure* closure) {
"call_combiner=%p: scheduling old cancel callback=%p", this,
closure);
}
ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
}
break;
}

@ -80,7 +80,7 @@ class CallCombiner {
/// once; this allows the closure to hold references that will be freed
/// regardless of whether or not the call was cancelled. If a cancellation
/// does occur, the closure will be scheduled with the cancellation error;
/// otherwise, it will be scheduled with GRPC_ERROR_NONE.
/// otherwise, it will be scheduled with absl::OkStatus().
///
/// The closure will be scheduled in the following cases:
/// - If Cancel() was called prior to registering the closure, it will be
@ -89,7 +89,7 @@ class CallCombiner {
/// be scheduled with the cancellation error.
/// - If SetNotifyOnCancel() is called again to register a new cancellation
/// closure, the previous cancellation closure will be scheduled with
/// GRPC_ERROR_NONE.
/// absl::OkStatus().
///
/// If \a closure is NULL, then no closure will be invoked on
/// cancellation; this effectively unregisters the previously set closure.

@ -45,7 +45,7 @@ typedef struct grpc_closure_list {
/** gRPC Callback definition.
*
* \param arg Arbitrary input.
* \param error GRPC_ERROR_NONE if no error occurred, otherwise some grpc_error
* \param error absl::OkStatus() if no error occurred, otherwise some grpc_error
* describing what went wrong.
* Error contract: it is not the cb's job to unref this error;
* the closure scheduler will do that after the cb returns */

@ -171,7 +171,7 @@ static void offload(void* arg, grpc_error_handle /*error*/) {
static void queue_offload(grpc_core::Combiner* lock) {
move_next();
GRPC_COMBINER_TRACE(gpr_log(GPR_INFO, "C:%p queue_offload", lock));
grpc_core::Executor::Run(&lock->offload, GRPC_ERROR_NONE);
grpc_core::Executor::Run(&lock->offload, absl::OkStatus());
}
bool grpc_combiner_continue_exec_ctx() {

@ -181,7 +181,7 @@ static void ReadAction(void* arg, grpc_error_handle error) {
if (read_size < static_cast<CFIndex>(len)) {
grpc_slice_buffer_trim_end(ep->read_slices, len - read_size, nullptr);
}
CallReadCb(ep, GRPC_ERROR_NONE);
CallReadCb(ep, absl::OkStatus());
EP_UNREF(ep, "read");
}
}
@ -219,7 +219,7 @@ static void WriteAction(void* arg, grpc_error_handle error) {
if (ep->write_slices->length > 0) {
ep->stream_sync->NotifyOnWrite(&ep->write_action);
} else {
CallWriteCb(ep, GRPC_ERROR_NONE);
CallWriteCb(ep, absl::OkStatus());
EP_UNREF(ep, "write");
}

@ -50,8 +50,8 @@ static void create_sockets(int sv[2]) {
GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
flags = fcntl(sv[1], F_GETFL, 0);
GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[0]) == GRPC_ERROR_NONE);
GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[1]) == GRPC_ERROR_NONE);
GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[0]) == absl::OkStatus());
GPR_ASSERT(grpc_set_socket_no_sigpipe_if_possible(sv[1]) == absl::OkStatus());
}
grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char* name,

@ -178,12 +178,12 @@ absl::Status grpc_status_create(absl::StatusCode code, absl::string_view msg,
errs)
// Consumes all the errors in the vector and forms a referencing error from
// them. If the vector is empty, return GRPC_ERROR_NONE.
// them. If the vector is empty, return absl::OkStatus().
template <typename VectorType>
static absl::Status grpc_status_create_from_vector(
const grpc_core::DebugLocation& location, absl::string_view desc,
VectorType* error_list) {
absl::Status error = GRPC_ERROR_NONE;
absl::Status error;
if (error_list->size() != 0) {
error = grpc_status_create(absl::StatusCode::kUnknown, desc, location,
error_list->size(), error_list->data());
@ -236,9 +236,9 @@ bool grpc_error_get_str(grpc_error_handle error, grpc_error_strs which,
/// child error.
///
/// Edge Conditions -
/// 1) If either of \a src or \a child is GRPC_ERROR_NONE, returns a reference
/// to the other argument. 2) If both \a src and \a child are GRPC_ERROR_NONE,
/// returns GRPC_ERROR_NONE. 3) If \a src and \a child point to the same error,
/// 1) If either of \a src or \a child is absl::OkStatus(), returns a reference
/// to the other argument. 2) If both \a src and \a child are absl::OkStatus(),
/// returns absl::OkStatus(). 3) If \a src and \a child point to the same error,
/// returns a single reference. (Note that, 2 references should have been
/// received to the error in this case.)
grpc_error_handle grpc_error_add_child(
@ -259,7 +259,7 @@ inline bool grpc_log_if_error(const char* what, grpc_error_handle error,
class AtomicError {
public:
AtomicError() {
error_ = GRPC_ERROR_NONE;
error_ = absl::OkStatus();
lock_ = GPR_SPINLOCK_STATIC_INITIALIZER;
}
explicit AtomicError(grpc_error_handle error) { error_ = error; }
@ -268,7 +268,7 @@ class AtomicError {
AtomicError(const AtomicError&) = delete;
AtomicError& operator=(const AtomicError&) = delete;
/// returns get() == GRPC_ERROR_NONE
/// returns get() == absl::OkStatus()
bool ok() {
gpr_spinlock_lock(&lock_);
bool ret = error_.ok();

@ -256,11 +256,11 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
// callback will be called.
if (apple_pollset->is_shutdown && apple_pollset->workers.empty()) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, apple_pollset->shutdown_closure,
GRPC_ERROR_NONE);
absl::OkStatus());
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/// Kick a specific worker. The caller must acquire the lock GrpcApplePollset.mu
@ -297,7 +297,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset,
kick_worker(actual_worker);
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
@ -318,7 +318,7 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
// If there is any worker blocked, shutdown will be done asynchronously.
if (apple_pollset->workers.empty()) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
} else {
apple_pollset->shutdown_closure = closure;
}

@ -404,7 +404,7 @@ static void fd_shutdown(grpc_fd* fd, grpc_error_handle why) {
static void fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd,
const char* reason) {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
bool is_release_fd = (release_fd != nullptr);
if (!fd->read_closure->IsShutdown()) {
@ -529,7 +529,7 @@ static grpc_error_handle pollset_global_init(void) {
for (size_t i = 0; i < g_num_neighborhoods; i++) {
gpr_mu_init(&g_neighborhoods[i].mu);
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void pollset_global_shutdown(void) {
@ -583,7 +583,7 @@ static void pollset_destroy(grpc_pollset* pollset) {
}
static grpc_error_handle pollset_kick_all(grpc_pollset* pollset) {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (pollset->root_worker != nullptr) {
grpc_pollset_worker* worker = pollset->root_worker;
do {
@ -615,7 +615,7 @@ static void pollset_maybe_finish_shutdown(grpc_pollset* pollset) {
if (pollset->shutdown_closure != nullptr && pollset->root_worker == nullptr &&
pollset->begin_refs == 0) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, pollset->shutdown_closure,
GRPC_ERROR_NONE);
absl::OkStatus());
pollset->shutdown_closure = nullptr;
}
}
@ -651,7 +651,7 @@ static int poll_deadline_to_millis_timeout(grpc_core::Timestamp millis) {
when accessing fields in g_epoll_set */
static grpc_error_handle process_epoll_events(grpc_pollset* /*pollset*/) {
static const char* err_desc = "process_events";
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
long num_events = gpr_atm_acq_load(&g_epoll_set.num_events);
long cursor = gpr_atm_acq_load(&g_epoll_set.cursor);
for (int idx = 0;
@ -723,7 +723,7 @@ static grpc_error_handle do_epoll_wait(grpc_pollset* ps,
gpr_atm_rel_store(&g_epoll_set.num_events, r);
gpr_atm_rel_store(&g_epoll_set.cursor, 0);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static bool begin_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
@ -992,11 +992,11 @@ static grpc_error_handle pollset_work(grpc_pollset* ps,
grpc_pollset_worker** worker_hdl,
grpc_core::Timestamp deadline) {
grpc_pollset_worker worker;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
static const char* err_desc = "pollset_work";
if (ps->kicked_without_poller) {
ps->kicked_without_poller = false;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
if (begin_worker(ps, &worker, worker_hdl, deadline)) {
@ -1040,7 +1040,7 @@ static grpc_error_handle pollset_work(grpc_pollset* ps,
static grpc_error_handle pollset_kick(grpc_pollset* pollset,
grpc_pollset_worker* specific_worker) {
grpc_error_handle ret_err = GRPC_ERROR_NONE;
grpc_error_handle ret_err;
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
std::vector<std::string> log;
log.push_back(absl::StrFormat(

@ -440,7 +440,8 @@ static void close_fd_locked(grpc_fd* fd) {
if (!fd->released) {
close(fd->fd);
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, fd->on_done_closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, fd->on_done_closure,
absl::OkStatus());
}
static int fd_wrapped_fd(grpc_fd* fd) {
@ -489,7 +490,7 @@ static void fd_unref(grpc_fd* fd) { unref_by(fd, 2); }
static grpc_error_handle fd_shutdown_error(grpc_fd* fd) {
if (!fd->shutdown) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else {
return grpc_error_set_int(GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(
"FD shutdown", &fd->shutdown_error, 1),
@ -577,7 +578,7 @@ static void fd_notify_on_error(grpc_fd* /*fd*/, grpc_closure* closure) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
gpr_log(GPR_ERROR, "Polling engine does not support tracking errors.");
}
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_CANCELLED);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::CancelledError());
}
static void fd_set_readable(grpc_fd* fd) {
@ -764,7 +765,7 @@ static void kick_append_error(grpc_error_handle* composite,
static grpc_error_handle pollset_kick_ext(grpc_pollset* p,
grpc_pollset_worker* specific_worker,
uint32_t flags) {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
/* pollset->mu already held */
if (specific_worker != nullptr) {
@ -826,7 +827,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* p,
/* global state management */
static grpc_error_handle pollset_global_init(void) { return GRPC_ERROR_NONE; }
static grpc_error_handle pollset_global_init(void) { return absl::OkStatus(); }
/* main interface */
@ -885,7 +886,7 @@ static void finish_shutdown(grpc_pollset* pollset) {
}
pollset->fd_count = 0;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, pollset->shutdown_done,
GRPC_ERROR_NONE);
absl::OkStatus());
}
static void work_combine_error(grpc_error_handle* composite,
@ -902,7 +903,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
grpc_core::Timestamp deadline) {
grpc_pollset_worker worker;
if (worker_hdl) *worker_hdl = &worker;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
/* Avoid malloc for small number of elements. */
enum { inline_elements = 96 };

@ -37,7 +37,7 @@ grpc_error_handle grpc_load_file(const char* filename, int add_null_terminator,
grpc_slice result = grpc_empty_slice();
FILE* file;
size_t bytes_read = 0;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
GRPC_SCHEDULING_START_BLOCKING_REGION;
file = fopen(filename, "rb");

@ -127,7 +127,7 @@ void LockfreeEvent::NotifyOn(grpc_closure* closure) {
closure when transitioning out of CLOSURE_NO_READY state (i.e there
is no other code that needs to 'happen-after' this) */
if (gpr_atm_no_barrier_cas(&state_, kClosureReady, kClosureNotReady)) {
ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
return; /* Successful. Return */
}
@ -246,7 +246,7 @@ void LockfreeEvent::SetReady() {
notify_on (or set_shutdown) */
else if (gpr_atm_full_cas(&state_, curr, kClosureNotReady)) {
ExecCtx::Run(DEBUG_LOCATION, reinterpret_cast<grpc_closure*>(curr),
GRPC_ERROR_NONE);
absl::OkStatus());
return;
}
/* else the state changed again (only possible by either a racing

@ -98,7 +98,7 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
pollset->shutting_down = 1;
grpc_pollset_kick(pollset, GRPC_POLLSET_KICK_BROADCAST);
if (!pollset->is_iocp_worker) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
} else {
pollset->on_shutdown = closure;
}
@ -147,7 +147,7 @@ static grpc_error_handle pollset_work(grpc_pollset* pollset,
if (pollset->shutting_down && pollset->on_shutdown != NULL) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, pollset->on_shutdown,
GRPC_ERROR_NONE);
absl::OkStatus());
pollset->on_shutdown = NULL;
}
goto done;
@ -180,7 +180,7 @@ done:
}
gpr_cv_destroy(&worker.cv);
if (worker_hdl) *worker_hdl = NULL;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle pollset_kick(grpc_pollset* p,
@ -231,7 +231,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* p,
gpr_cv_signal(&next_global_worker->cv);
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_pollset_vtable grpc_windows_pollset_vtable = {

@ -37,7 +37,7 @@ class DNSCallbackExecCtxScheduler {
absl::StatusOr<std::vector<grpc_resolved_address>> param)
: on_done_(std::move(on_done)), param_(std::move(param)) {
GRPC_CLOSURE_INIT(&closure_, RunCallback, this, grpc_schedule_on_exec_ctx);
ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, &closure_, absl::OkStatus());
}
private:

@ -57,7 +57,7 @@ class NativeDNSRequest {
on_done)
: name_(name), default_port_(default_port), on_done_(std::move(on_done)) {
GRPC_CLOSURE_INIT(&request_closure_, DoRequestThread, this, nullptr);
Executor::Run(&request_closure_, GRPC_ERROR_NONE, ExecutorType::RESOLVER);
Executor::Run(&request_closure_, absl::OkStatus(), ExecutorType::RESOLVER);
}
private:
@ -165,7 +165,7 @@ NativeDNSResolver::LookupHostnameBlocking(absl::string_view name,
addr.len = resp->ai_addrlen;
addresses.push_back(addr);
}
err = GRPC_ERROR_NONE;
err = absl::OkStatus();
done:
if (result) {
freeaddrinfo(result);

@ -60,7 +60,7 @@ class NativeDNSRequest {
on_done)
: name_(name), default_port_(default_port), on_done_(std::move(on_done)) {
GRPC_CLOSURE_INIT(&request_closure_, DoRequestThread, this, nullptr);
Executor::Run(&request_closure_, GRPC_ERROR_NONE, ExecutorType::RESOLVER);
Executor::Run(&request_closure_, absl::OkStatus(), ExecutorType::RESOLVER);
}
private:
@ -107,7 +107,7 @@ NativeDNSResolver::LookupHostnameBlocking(absl::string_view name,
struct addrinfo *result = NULL, *resp;
int s;
size_t i;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
std::vector<grpc_resolved_address> addresses;
// parse name, splitting it into host and port parts

@ -60,7 +60,7 @@ grpc_error_handle grpc_set_socket_zerocopy(int fd) {
if (err != 0) {
return GRPC_OS_ERROR(errno, "setsockopt(SO_ZEROCOPY)");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
#else
(void)fd;
return GRPC_OS_ERROR(ENOSYS, "setsockopt(SO_ZEROCOPY)");
@ -84,7 +84,7 @@ grpc_error_handle grpc_set_socket_nonblocking(int fd, int non_blocking) {
return GRPC_OS_ERROR(errno, "fcntl");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_set_socket_no_sigpipe_if_possible(int fd) {
@ -105,7 +105,7 @@ grpc_error_handle grpc_set_socket_no_sigpipe_if_possible(int fd) {
// Avoid unused parameter warning for conditional parameter
(void)fd;
#endif
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_set_socket_ip_pktinfo_if_possible(int fd) {
@ -118,7 +118,7 @@ grpc_error_handle grpc_set_socket_ip_pktinfo_if_possible(int fd) {
return GRPC_OS_ERROR(errno, "setsockopt(IP_PKTINFO)");
}
#endif
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
@ -131,20 +131,20 @@ grpc_error_handle grpc_set_socket_ipv6_recvpktinfo_if_possible(int fd) {
return GRPC_OS_ERROR(errno, "setsockopt(IPV6_RECVPKTINFO)");
}
#endif
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_set_socket_sndbuf(int fd, int buffer_size_bytes) {
return 0 == setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &buffer_size_bytes,
sizeof(buffer_size_bytes))
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_OS_ERROR(errno, "setsockopt(SO_SNDBUF)");
}
grpc_error_handle grpc_set_socket_rcvbuf(int fd, int buffer_size_bytes) {
return 0 == setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &buffer_size_bytes,
sizeof(buffer_size_bytes))
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_OS_ERROR(errno, "setsockopt(SO_RCVBUF)");
}
@ -165,7 +165,7 @@ grpc_error_handle grpc_set_socket_cloexec(int fd, int close_on_exec) {
return GRPC_OS_ERROR(errno, "fcntl");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* set a socket to reuse old addresses */
@ -183,7 +183,7 @@ grpc_error_handle grpc_set_socket_reuse_addr(int fd, int reuse) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to set SO_REUSEADDR");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* set a socket to reuse old addresses */
@ -205,7 +205,7 @@ grpc_error_handle grpc_set_socket_reuse_port(int fd, int reuse) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to set SO_REUSEPORT");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
#endif
}
@ -245,7 +245,7 @@ grpc_error_handle grpc_set_socket_low_latency(int fd, int low_latency) {
if ((newval != 0) != val) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Failed to set TCP_NODELAY");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* The default values for TCP_USER_TIMEOUT are currently configured to be in
@ -348,17 +348,17 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout(
sizeof(timeout))) {
gpr_log(GPR_ERROR, "setsockopt(TCP_USER_TIMEOUT) %s",
strerror(errno));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
if (0 != getsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &newval, &len)) {
gpr_log(GPR_ERROR, "getsockopt(TCP_USER_TIMEOUT) %s",
strerror(errno));
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
if (newval != timeout) {
/* Do not fail on failing to set TCP_USER_TIMEOUT for now. */
gpr_log(GPR_ERROR, "Failed to set TCP_USER_TIMEOUT");
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
}
}
@ -367,7 +367,7 @@ grpc_error_handle grpc_set_socket_tcp_user_timeout(
gpr_log(GPR_INFO, "TCP_USER_TIMEOUT not supported for this platform");
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* set a socket using a grpc_socket_mutator */
@ -377,13 +377,13 @@ grpc_error_handle grpc_set_socket_with_mutator(int fd, grpc_fd_usage usage,
if (!grpc_socket_mutator_mutate_fd(mutator, fd, usage)) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("grpc_socket_mutator failed.");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
grpc_error_handle grpc_apply_socket_mutator_in_args(
int fd, grpc_fd_usage usage, const grpc_core::PosixTcpOptions& options) {
if (options.socket_mutator == nullptr) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
return grpc_set_socket_with_mutator(fd, usage, options.socket_mutator);
}
@ -418,7 +418,7 @@ int grpc_ipv6_loopback_available(void) {
static grpc_error_handle error_for_fd(int fd,
const grpc_resolved_address* addr) {
if (fd >= 0) return GRPC_ERROR_NONE;
if (fd >= 0) return absl::OkStatus();
auto addr_str = grpc_sockaddr_to_string(addr, false);
grpc_error_handle err = grpc_error_set_str(
GRPC_OS_ERROR(errno, "socket"), GRPC_ERROR_STR_TARGET_ADDRESS,
@ -456,7 +456,7 @@ grpc_error_handle grpc_create_dualstack_socket_using_factory(
/* Check if we've got a valid dualstack socket. */
if (*newfd >= 0 && grpc_set_socket_dualstack(*newfd)) {
*dsmode = GRPC_DSMODE_DUALSTACK;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
/* If this isn't an IPv4 address, then return whatever we've got. */
if (!grpc_sockaddr_is_v4mapped(resolved_addr, nullptr)) {

@ -123,7 +123,7 @@ static void socket_notify_on_iocp(grpc_winsocket* socket, grpc_closure* closure,
gpr_mu_lock(&socket->state_mu);
if (info->has_pending_iocp) {
info->has_pending_iocp = 0;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
} else {
info->closure = closure;
}
@ -144,7 +144,7 @@ void grpc_socket_become_ready(grpc_winsocket* socket,
GPR_ASSERT(!info->has_pending_iocp);
gpr_mu_lock(&socket->state_mu);
if (info->closure) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, info->closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, info->closure, absl::OkStatus());
info->closure = NULL;
} else {
info->has_pending_iocp = 1;

@ -94,7 +94,7 @@ void grpc_tcp_client_global_init() {
static grpc_error_handle prepare_socket(
const grpc_resolved_address* addr, int fd,
const grpc_core::PosixTcpOptions& options) {
grpc_error_handle err = GRPC_ERROR_NONE;
grpc_error_handle err;
GPR_ASSERT(fd >= 0);
@ -193,7 +193,7 @@ static void on_writable(void* acp, grpc_error_handle error) {
if (connect_cancelled) {
// The callback should not get scheduled in this case.
error = GRPC_ERROR_NONE;
error = absl::OkStatus();
goto finish;
}
@ -306,10 +306,10 @@ grpc_error_handle grpc_tcp_client_prepare_fd(
memcpy(mapped_addr, addr, sizeof(*mapped_addr));
}
}
if ((error = prepare_socket(mapped_addr, *fd, options)) != GRPC_ERROR_NONE) {
if ((error = prepare_socket(mapped_addr, *fd, options)) != absl::OkStatus()) {
return error;
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
int64_t grpc_tcp_client_create_from_prepared_fd(
@ -343,7 +343,7 @@ int64_t grpc_tcp_client_create_from_prepared_fd(
// Connection already succeded. Return 0 to discourage any cancellation
// attempts.
*ep = grpc_tcp_client_create_from_fd(fdobj, options, addr_uri.value());
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, absl::OkStatus());
return 0;
}
if (errno != EWOULDBLOCK && errno != EINPROGRESS) {
@ -404,7 +404,7 @@ static int64_t tcp_connect(grpc_closure* closure, grpc_endpoint** ep,
grpc_error_handle error;
*ep = nullptr;
if ((error = grpc_tcp_client_prepare_fd(options, addr, &mapped_addr, &fd)) !=
GRPC_ERROR_NONE) {
absl::OkStatus()) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, closure, error);
return 0;
}
@ -450,7 +450,7 @@ static bool tcp_cancel_connect(int64_t connection_handle) {
// Shutdown the fd. This would cause on_writable to run as soon as possible.
// We dont need to pass a custom error here because it wont be used since
// the on_connect_closure is not run if connect cancellation is successfull.
grpc_fd_shutdown(ac->fd, GRPC_ERROR_NONE);
grpc_fd_shutdown(ac->fd, absl::OkStatus());
}
bool done = (--ac->refs == 0);
gpr_mu_unlock(&ac->mu);

@ -135,7 +135,7 @@ static int64_t tcp_connect(grpc_closure* on_done, grpc_endpoint** endpoint,
GUID guid = WSAID_CONNECTEX;
DWORD ioctl_num_bytes;
grpc_winsocket_callback_info* info;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
async_connect* ac = NULL;
absl::StatusOr<std::string> addr_uri;

@ -606,7 +606,7 @@ static void run_poller(void* bp, grpc_error_handle /*error_ignored*/) {
if (GRPC_TRACE_FLAG_ENABLED(grpc_tcp_trace)) {
gpr_log(GPR_INFO, "BACKUP_POLLER:%p reschedule", p);
}
grpc_core::Executor::Run(&p->run_poller, GRPC_ERROR_NONE,
grpc_core::Executor::Run(&p->run_poller, absl::OkStatus(),
grpc_core::ExecutorType::DEFAULT,
grpc_core::ExecutorJobType::LONG);
}
@ -649,7 +649,7 @@ static void cover_self(grpc_tcp* tcp) {
}
grpc_core::Executor::Run(
GRPC_CLOSURE_INIT(&p->run_poller, run_poller, p, nullptr),
GRPC_ERROR_NONE, grpc_core::ExecutorType::DEFAULT,
absl::OkStatus(), grpc_core::ExecutorType::DEFAULT,
grpc_core::ExecutorJobType::LONG);
} else {
old_count = g_uncovered_notifications_pending++;
@ -1011,7 +1011,7 @@ static bool tcp_do_read(grpc_tcp* tcp, grpc_error_handle* error)
}
GPR_DEBUG_ASSERT(total_read_bytes > 0);
*error = GRPC_ERROR_NONE;
*error = absl::OkStatus();
if (tcp->frame_size_tuning_enabled) {
// Update min progress size based on the total number of bytes read in
// this round.
@ -1176,7 +1176,7 @@ static void tcp_read(grpc_endpoint* ep, grpc_slice_buffer* incoming_buffer,
* bytes or calls notify_on_read() to be notified when new bytes become
* available */
grpc_core::Closure::Run(DEBUG_LOCATION, &tcp->read_done_closure,
GRPC_ERROR_NONE);
absl::OkStatus());
}
}
@ -1647,7 +1647,7 @@ static bool do_tcp_flush_zerocopy(grpc_tcp* tcp, TcpZerocopySendRecord* record,
record->UpdateOffsetForBytesSent(sending_length,
static_cast<size_t>(sent_length));
if (record->AllSlicesSent()) {
*error = GRPC_ERROR_NONE;
*error = absl::OkStatus();
return true;
}
}
@ -1777,7 +1777,7 @@ static bool tcp_flush(grpc_tcp* tcp, grpc_error_handle* error) {
}
}
if (outgoing_slice_idx == tcp->outgoing_buffer->count) {
*error = GRPC_ERROR_NONE;
*error = absl::OkStatus();
grpc_slice_buffer_reset_and_unref(tcp->outgoing_buffer);
return true;
}
@ -1828,7 +1828,7 @@ static void tcp_handle_write(void* arg /* grpc_tcp */,
static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
grpc_closure* cb, void* arg, int /*max_frame_size*/) {
grpc_tcp* tcp = reinterpret_cast<grpc_tcp*>(ep);
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
TcpZerocopySendRecord* zerocopy_send_record = nullptr;
grpc_core::EventLog::Append("tcp-write-outstanding", buf->length);
@ -1856,7 +1856,7 @@ static void tcp_write(grpc_endpoint* ep, grpc_slice_buffer* buf,
grpc_fd_is_shutdown(tcp->em_fd)
? tcp_annotate_error(GRPC_ERROR_CREATE_FROM_STATIC_STRING("EOF"),
tcp)
: GRPC_ERROR_NONE);
: absl::OkStatus());
tcp_shutdown_buffer_list(tcp);
return;
}

@ -99,7 +99,7 @@ static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
s->memory_quota = s->options.resource_quota->memory_quota();
gpr_atm_no_barrier_store(&s->next_pollset_to_assign, 0);
*server = s;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void finish_shutdown(grpc_tcp_server* s) {
@ -108,7 +108,7 @@ static void finish_shutdown(grpc_tcp_server* s) {
gpr_mu_unlock(&s->mu);
if (s->shutdown_complete != nullptr) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
GRPC_ERROR_NONE);
absl::OkStatus());
}
gpr_mu_destroy(&s->mu);
while (s->head) {
@ -303,8 +303,8 @@ static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s,
grpc_dualstack_mode dsmode;
grpc_tcp_listener* sp = nullptr;
grpc_tcp_listener* sp2 = nullptr;
grpc_error_handle v6_err = GRPC_ERROR_NONE;
grpc_error_handle v4_err = GRPC_ERROR_NONE;
grpc_error_handle v6_err;
grpc_error_handle v4_err;
*out_port = -1;
if (grpc_tcp_server_have_ifaddrs() && s->expand_wildcard_addrs) {
@ -315,17 +315,17 @@ static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s,
grpc_sockaddr_make_wildcards(requested_port, &wild4, &wild6);
/* Try listening on IPv6 first. */
if ((v6_err = grpc_tcp_server_add_addr(s, &wild6, port_index, fd_index,
&dsmode, &sp)) == GRPC_ERROR_NONE) {
&dsmode, &sp)) == absl::OkStatus()) {
++fd_index;
requested_port = *out_port = sp->port;
if (dsmode == GRPC_DSMODE_DUALSTACK || dsmode == GRPC_DSMODE_IPV4) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
}
/* If we got a v6-only socket or nothing, try adding 0.0.0.0. */
grpc_sockaddr_set_port(&wild4, requested_port);
if ((v4_err = grpc_tcp_server_add_addr(s, &wild4, port_index, fd_index,
&dsmode, &sp2)) == GRPC_ERROR_NONE) {
&dsmode, &sp2)) == absl::OkStatus()) {
*out_port = sp2->port;
if (sp != nullptr) {
sp2->is_sibling = 1;
@ -345,7 +345,7 @@ static grpc_error_handle add_wildcard_addrs_to_server(grpc_tcp_server* s,
"the environment may not support IPv4: %s",
grpc_error_std_string(v4_err).c_str());
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
} else {
grpc_error_handle root_err = GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"Failed to add any wildcard listeners");
@ -406,7 +406,7 @@ static grpc_error_handle clone_port(grpc_tcp_listener* listener,
}
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
@ -455,7 +455,7 @@ static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
addr = &addr6_v4mapped;
}
if ((err = grpc_tcp_server_add_addr(s, addr, port_index, 0, &dsmode, &sp)) ==
GRPC_ERROR_NONE) {
absl::OkStatus()) {
*out_port = sp->port;
}
return err;
@ -552,7 +552,7 @@ static void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
grpc_closure* shutdown_starting) {
gpr_mu_lock(&s->mu);
grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
GRPC_ERROR_NONE);
absl::OkStatus());
gpr_mu_unlock(&s->mu);
}

@ -112,7 +112,7 @@ grpc_error_handle grpc_tcp_server_add_addr(grpc_tcp_server* s,
/* Get all addresses assigned to network interfaces on the machine and create a
listener for each. requested_port is the port to use for every listener, or 0
to select one random port that will be used for every listener. Set *out_port
to the port selected. Return GRPC_ERROR_NONE only if all listeners were
to the port selected. Return absl::OkStatus() only if all listeners were
added. */
grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
unsigned port_index,

@ -152,7 +152,7 @@ grpc_error_handle grpc_tcp_server_prepare_socket(
grpc_tcp_server* s, int fd, const grpc_resolved_address* addr,
bool so_reuseport, int* port) {
grpc_resolved_address sockname_temp;
grpc_error_handle err = GRPC_ERROR_NONE;
grpc_error_handle err;
GPR_ASSERT(fd >= 0);
@ -208,7 +208,7 @@ grpc_error_handle grpc_tcp_server_prepare_socket(
}
*port = grpc_sockaddr_get_port(&sockname_temp);
return GRPC_ERROR_NONE;
return absl::OkStatus();
error:
GPR_ASSERT(!err.ok());

@ -86,7 +86,7 @@ static grpc_error_handle get_unused_port(int* port) {
close(fd);
*port = grpc_sockaddr_get_port(&wild);
return *port <= 0 ? GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad port")
: GRPC_ERROR_NONE;
: absl::OkStatus();
}
grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
@ -97,13 +97,13 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
struct ifaddrs* ifa_it;
unsigned fd_index = 0;
grpc_tcp_listener* sp = nullptr;
grpc_error_handle err = GRPC_ERROR_NONE;
grpc_error_handle err;
if (requested_port == 0) {
/* Note: There could be a race where some local addrs can listen on the
selected port and some can't. The sane way to handle this would be to
retry by recreating the whole grpc_tcp_server. Backing out individual
listeners and orphaning the FDs looks like too much trouble. */
if ((err = get_unused_port(&requested_port)) != GRPC_ERROR_NONE) {
if ((err = get_unused_port(&requested_port)) != absl::OkStatus()) {
return err;
} else if (requested_port <= 0) {
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("Bad get_unused_port()");
@ -148,7 +148,7 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
continue;
}
if ((err = grpc_tcp_server_add_addr(s, &addr, port_index, fd_index, &dsmode,
&new_sp)) != GRPC_ERROR_NONE) {
&new_sp)) != absl::OkStatus()) {
grpc_error_handle root_err = GRPC_ERROR_CREATE_FROM_CPP_STRING(
absl::StrCat("Failed to add listener: ", addr_str.value()));
err = grpc_error_add_child(root_err, err);
@ -170,7 +170,7 @@ grpc_error_handle grpc_tcp_server_add_all_local_addrs(grpc_tcp_server* s,
return GRPC_ERROR_CREATE_FROM_STATIC_STRING("No local addresses");
} else {
*out_port = sp->port;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
}

@ -116,7 +116,7 @@ static grpc_error_handle tcp_server_create(grpc_closure* shutdown_complete,
s->shutdown_starting.tail = NULL;
s->shutdown_complete = shutdown_complete;
*server = s;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void destroy_server(void* arg, grpc_error_handle error) {
@ -139,13 +139,13 @@ static void destroy_server(void* arg, grpc_error_handle error) {
static void finish_shutdown_locked(grpc_tcp_server* s) {
if (s->shutdown_complete != NULL) {
grpc_core::ExecCtx::Run(DEBUG_LOCATION, s->shutdown_complete,
GRPC_ERROR_NONE);
absl::OkStatus());
}
grpc_core::ExecCtx::Run(
DEBUG_LOCATION,
GRPC_CLOSURE_CREATE(destroy_server, s, grpc_schedule_on_exec_ctx),
GRPC_ERROR_NONE);
absl::OkStatus());
}
static grpc_tcp_server* tcp_server_ref(grpc_tcp_server* s) {
@ -157,7 +157,7 @@ static void tcp_server_shutdown_starting_add(grpc_tcp_server* s,
grpc_closure* shutdown_starting) {
gpr_mu_lock(&s->mu);
grpc_closure_list_append(&s->shutdown_starting, shutdown_starting,
GRPC_ERROR_NONE);
absl::OkStatus());
gpr_mu_unlock(&s->mu);
}
@ -192,7 +192,7 @@ static grpc_error_handle prepare_socket(SOCKET sock,
const grpc_resolved_address* addr,
int* port) {
grpc_resolved_address sockname_temp;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
int sockname_temp_len;
error = grpc_tcp_prepare_socket(sock);
@ -220,7 +220,7 @@ static grpc_error_handle prepare_socket(SOCKET sock,
sockname_temp.len = (size_t)sockname_temp_len;
*port = grpc_sockaddr_get_port(&sockname_temp);
return GRPC_ERROR_NONE;
return absl::OkStatus();
failure:
GPR_ASSERT(!error.ok());
@ -251,10 +251,10 @@ static grpc_error_handle start_accept_locked(grpc_tcp_listener* port) {
BOOL success;
DWORD addrlen = sizeof(grpc_sockaddr_in6) + 16;
DWORD bytes_received = 0;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (port->shutting_down) {
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
sock = WSASocket(AF_INET6, SOCK_STREAM, IPPROTO_TCP, NULL, 0,
@ -400,7 +400,7 @@ static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
GUID guid = WSAID_ACCEPTEX;
DWORD ioctl_num_bytes;
LPFN_ACCEPTEX AcceptEx;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
/* We need to grab the AcceptEx pointer for that port, as it may be
interface-dependent. We'll cache it to avoid doing that again. */
@ -413,7 +413,7 @@ static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
gpr_log(GPR_ERROR, "on_connect error: %s", utf8_message);
gpr_free(utf8_message);
closesocket(sock);
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
error = prepare_socket(sock, addr, &port);
@ -445,7 +445,7 @@ static grpc_error_handle add_socket_to_server(grpc_tcp_server* s, SOCKET sock,
gpr_mu_unlock(&s->mu);
*listener = sp;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
@ -458,7 +458,7 @@ static grpc_error_handle tcp_server_add_port(grpc_tcp_server* s,
grpc_resolved_address* allocated_addr = NULL;
grpc_resolved_address sockname_temp;
unsigned port_index = 0;
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (s->tail != NULL) {
port_index = s->tail->port_index + 1;

@ -60,7 +60,7 @@ grpc_error_handle grpc_tcp_set_non_block(SOCKET sock) {
status = WSAIoctl(sock, GRPC_FIONBIO, &param, sizeof(param), NULL, 0, &ret,
NULL, NULL);
return status == 0
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_WSA_ERROR(WSAGetLastError(), "WSAIoctl(GRPC_FIONBIO)");
}
@ -70,7 +70,7 @@ static grpc_error_handle set_dualstack(SOCKET sock) {
status = setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&param,
sizeof(param));
return status == 0
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_WSA_ERROR(WSAGetLastError(), "setsockopt(IPV6_V6ONLY)");
}
@ -82,7 +82,7 @@ static grpc_error_handle enable_socket_low_latency(SOCKET sock) {
if (status == SOCKET_ERROR) {
status = WSAGetLastError();
}
return status == 0 ? GRPC_ERROR_NONE
return status == 0 ? absl::OkStatus()
: GRPC_WSA_ERROR(status, "setsockopt(TCP_NODELAY)");
}
@ -94,7 +94,7 @@ grpc_error_handle grpc_tcp_prepare_socket(SOCKET sock) {
if (!err.ok()) return err;
err = enable_socket_low_latency(sock);
if (!err.ok()) return err;
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
typedef struct grpc_tcp {
@ -288,7 +288,7 @@ static void win_read(grpc_endpoint* ep, grpc_slice_buffer* read_slices,
/* Did we get data immediately ? Yay. */
if (info->wsa_error != WSAEWOULDBLOCK) {
info->bytes_transferred = bytes_read;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, &tcp->on_read, absl::OkStatus());
return;
}
@ -398,7 +398,7 @@ static void win_write(grpc_endpoint* ep, grpc_slice_buffer* slices,
avoid doing an async write operation at all. */
if (info->wsa_error != WSAEWOULDBLOCK) {
grpc_error_handle error = status == 0
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_WSA_ERROR(info->wsa_error, "WSASend");
grpc_core::ExecCtx::Run(DEBUG_LOCATION, cb, error);
if (allocated) gpr_free(allocated);

@ -70,12 +70,12 @@ typedef struct grpc_timer_vtable {
} grpc_timer_vtable;
/* Initialize *timer. When expired or canceled, closure will be called with
error set to indicate if it expired (GRPC_ERROR_NONE) or was canceled
(GRPC_ERROR_CANCELLED). *closure is guaranteed to be called exactly once, and
application code should check the error to determine how it was invoked. The
application callback is also responsible for maintaining information about
when to free up any user-level state. Behavior is undefined for a deadline of
grpc_core::Timestamp::InfFuture(). */
error set to indicate if it expired (absl::OkStatus()) or was canceled
(absl::CancelledError()). *closure is guaranteed to be called exactly once,
and application code should check the error to determine how it was invoked.
The application callback is also responsible for maintaining information
about when to free up any user-level state. Behavior is undefined for a
deadline of grpc_core::Timestamp::InfFuture(). */
void grpc_timer_init(grpc_timer* timer, grpc_core::Timestamp deadline,
grpc_closure* closure);
@ -99,8 +99,8 @@ void grpc_timer_init_unset(grpc_timer* timer);
In all of these cases, the cancellation is still considered successful.
They are essentially distinguished in that the timer_cb will be run
exactly once from either the cancellation (with error GRPC_ERROR_CANCELLED)
or from the activation (with error GRPC_ERROR_NONE).
exactly once from either the cancellation (with error absl::CancelledError())
or from the activation (with error absl::OkStatus()).
Note carefully that the callback function MAY occur in the same callstack
as grpc_timer_cancel. It's expected that most timers will be cancelled (their

@ -360,7 +360,7 @@ static void timer_init(grpc_timer* timer, grpc_core::Timestamp deadline,
grpc_core::Timestamp now = grpc_core::Timestamp::Now();
if (deadline <= now) {
timer->pending = false;
grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure, GRPC_ERROR_NONE);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure, absl::OkStatus());
gpr_mu_unlock(&shard->mu);
/* early out */
return;
@ -450,7 +450,7 @@ static void timer_cancel(grpc_timer* timer) {
REMOVE_FROM_HASH_TABLE(timer);
grpc_core::ExecCtx::Run(DEBUG_LOCATION, timer->closure,
GRPC_ERROR_CANCELLED);
absl::CancelledError());
timer->pending = false;
if (timer->heap_index == INVALID_HEAP_INDEX) {
list_remove(timer);
@ -683,7 +683,7 @@ static grpc_timer_check_result timer_check(grpc_core::Timestamp* next) {
grpc_error_handle shutdown_error =
now != grpc_core::Timestamp::InfFuture()
? GRPC_ERROR_NONE
? absl::OkStatus()
: GRPC_ERROR_CREATE_FROM_STATIC_STRING("Shutting down timer system");
// tracing

@ -36,7 +36,7 @@ static grpc_error_handle eventfd_create(grpc_wakeup_fd* fd_info) {
if (fd_info->read_fd < 0) {
return GRPC_OS_ERROR(errno, "eventfd");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle eventfd_consume(grpc_wakeup_fd* fd_info) {
@ -48,7 +48,7 @@ static grpc_error_handle eventfd_consume(grpc_wakeup_fd* fd_info) {
if (err < 0 && errno != EAGAIN) {
return GRPC_OS_ERROR(errno, "eventfd_read");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle eventfd_wakeup(grpc_wakeup_fd* fd_info) {
@ -59,7 +59,7 @@ static grpc_error_handle eventfd_wakeup(grpc_wakeup_fd* fd_info) {
if (err < 0) {
return GRPC_OS_ERROR(errno, "eventfd_write");
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void eventfd_destroy(grpc_wakeup_fd* fd_info) {

@ -46,7 +46,7 @@ static grpc_error_handle pipe_init(grpc_wakeup_fd* fd_info) {
if (!err.ok()) return err;
fd_info->read_fd = pipefd[0];
fd_info->write_fd = pipefd[1];
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static grpc_error_handle pipe_consume(grpc_wakeup_fd* fd_info) {
@ -56,10 +56,10 @@ static grpc_error_handle pipe_consume(grpc_wakeup_fd* fd_info) {
for (;;) {
r = read(fd_info->read_fd, buf, sizeof(buf));
if (r > 0) continue;
if (r == 0) return GRPC_ERROR_NONE;
if (r == 0) return absl::OkStatus();
switch (errno) {
case EAGAIN:
return GRPC_ERROR_NONE;
return absl::OkStatus();
case EINTR:
continue;
default:
@ -72,7 +72,7 @@ static grpc_error_handle pipe_wakeup(grpc_wakeup_fd* fd_info) {
char c = 0;
while (write(fd_info->write_fd, &c, 1) != 1 && errno == EINTR) {
}
return GRPC_ERROR_NONE;
return absl::OkStatus();
}
static void pipe_destroy(grpc_wakeup_fd* fd_info) {
@ -84,7 +84,7 @@ static int pipe_check_availability(void) {
grpc_wakeup_fd fd;
fd.read_fd = fd.write_fd = -1;
if (pipe_init(&fd) == GRPC_ERROR_NONE) {
if (pipe_init(&fd) == absl::OkStatus()) {
pipe_destroy(&fd);
return 1;
} else {

@ -85,7 +85,7 @@ LoadBalancingPolicy::PickResult LoadBalancingPolicy::QueuePicker::Pick(
DEBUG_LOCATION);
},
parent, nullptr),
GRPC_ERROR_NONE);
absl::OkStatus());
}
return PickResult::Queue();
}

@ -17,6 +17,8 @@
#include <grpc/support/port_platform.h>
#include "absl/status/status.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/error.h"
@ -36,7 +38,7 @@ class ExecCtxWakeupScheduler {
static_cast<ActivityType*>(arg)->RunScheduledWakeup();
},
activity, grpc_schedule_on_exec_ctx);
ExecCtx::Run(DEBUG_LOCATION, &closure_, GRPC_ERROR_NONE);
ExecCtx::Run(DEBUG_LOCATION, &closure_, absl::OkStatus());
}
private:

@ -461,7 +461,7 @@ void AwsExternalAccountCredentials::OnRetrieveSigningKeysInternal(
}
void AwsExternalAccountCredentials::BuildSubjectToken() {
grpc_error_handle error = GRPC_ERROR_NONE;
grpc_error_handle error;
if (signer_ == nullptr) {
cred_verification_url_ = absl::StrReplaceAll(
regional_cred_verification_url_, {{"{region}", region_}});
@ -501,7 +501,7 @@ void AwsExternalAccountCredentials::BuildSubjectToken() {
{"headers", Json(headers)}};
Json subject_token_json(object);
std::string subject_token = UrlEncode(subject_token_json.Dump());
FinishRetrieveSubjectToken(subject_token, GRPC_ERROR_NONE);
FinishRetrieveSubjectToken(subject_token, absl::OkStatus());
}
void AwsExternalAccountCredentials::FinishRetrieveSubjectToken(
@ -515,7 +515,7 @@ void AwsExternalAccountCredentials::FinishRetrieveSubjectToken(
if (!error.ok()) {
cb("", error);
} else {
cb(subject_token, GRPC_ERROR_NONE);
cb(subject_token, absl::OkStatus());
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save