diff --git a/src/core/ext/filters/client_channel/client_channel.cc b/src/core/ext/filters/client_channel/client_channel.cc index a8395d8d504..ed61537cb03 100644 --- a/src/core/ext/filters/client_channel/client_channel.cc +++ b/src/core/ext/filters/client_channel/client_channel.cc @@ -2059,6 +2059,7 @@ void CallData::Destroy(grpc_call_element* elem, then_schedule_closure = nullptr; } calld->~CallData(); + // TODO(yashkt) : This can potentially be a Closure::Run ExecCtx::Run(DEBUG_LOCATION, then_schedule_closure, GRPC_ERROR_NONE); } diff --git a/src/core/lib/iomgr/call_combiner.h b/src/core/lib/iomgr/call_combiner.h index c440241d0da..d3f43cf547f 100644 --- a/src/core/lib/iomgr/call_combiner.h +++ b/src/core/lib/iomgr/call_combiner.h @@ -157,7 +157,7 @@ class CallCombinerClosureList { // // All but one of the closures in the list will be scheduled via // GRPC_CALL_COMBINER_START(), and the remaining closure will be - // scheduled via ExecCtx::Run(DEBUG_LOCATION,), which will eventually result + // scheduled via ExecCtx::Run(), which will eventually result // in yielding the call combiner. If the list is empty, then the call // combiner will be yielded immediately. void RunClosures(CallCombiner* call_combiner) { diff --git a/src/core/lib/iomgr/exec_ctx.cc b/src/core/lib/iomgr/exec_ctx.cc index 9a5ad6eee0a..5c40c00d49c 100644 --- a/src/core/lib/iomgr/exec_ctx.cc +++ b/src/core/lib/iomgr/exec_ctx.cc @@ -176,28 +176,28 @@ grpc_millis ExecCtx::Now() { void ExecCtx::Run(const DebugLocation& location, grpc_closure* closure, grpc_error* error) { - if (closure != nullptr) { -#ifndef NDEBUG - if (closure->scheduled) { - gpr_log(GPR_ERROR, - "Closure already scheduled. (closure: %p, created: [%s:%d], " - "previously scheduled at: [%s: %d], newly scheduled at [%s: %d], " - "run?: %s", - closure, closure->file_created, closure->line_created, - closure->file_initiated, closure->line_initiated, location.file(), - location.line(), closure->run ? "true" : "false"); - abort(); - } - closure->scheduled = true; - closure->file_initiated = location.file(); - closure->line_initiated = location.line(); - closure->run = false; - GPR_ASSERT(closure->cb != nullptr); -#endif - exec_ctx_sched(closure, error); - } else { + if (closure == nullptr) { GRPC_ERROR_UNREF(error); + return; } +#ifndef NDEBUG + if (closure->scheduled) { + gpr_log(GPR_ERROR, + "Closure already scheduled. (closure: %p, created: [%s:%d], " + "previously scheduled at: [%s: %d], newly scheduled at [%s: %d], " + "run?: %s", + closure, closure->file_created, closure->line_created, + closure->file_initiated, closure->line_initiated, location.file(), + location.line(), closure->run ? "true" : "false"); + abort(); + } + closure->scheduled = true; + closure->file_initiated = location.file(); + closure->line_initiated = location.line(); + closure->run = false; + GPR_ASSERT(closure->cb != nullptr); +#endif + exec_ctx_sched(closure, error); } } // namespace grpc_core