| 240 | } |
| 241 | |
| 242 | void Coordinator::BackendState::ExecCompleteCb( |
| 243 | TypedCountingBarrier<Status>* exec_status_barrier, int64_t start_ms) { |
| 244 | { |
| 245 | lock_guard<mutex> l(lock_); |
| 246 | exec_rpc_status_ = exec_rpc_controller_.status(); |
| 247 | |
| 248 | Status complete_cb_debug_status = |
| 249 | DebugAction(exec_params_.query_options(), "IMPALA_MISS_EXEC_COMPLETE_CB"); |
| 250 | if (UNLIKELY(exec_rpc_status_.ok() && !complete_cb_debug_status.ok())) { |
| 251 | // Simulate the missing of callback for successful RPC. |
| 252 | LOG(ERROR) << "Debug action: missing ExecComplete callback"; |
| 253 | return; |
| 254 | } |
| 255 | |
| 256 | rpc_latency_ = MonotonicMillis() - start_ms; |
| 257 | |
| 258 | if (!exec_rpc_status_.ok()) { |
| 259 | // Return CANCELLED instead of ABORTED if the RPC is cancelled. |
| 260 | if (cancel_exec_rpc_ && exec_rpc_status_.IsAborted()) { |
| 261 | LOG(ERROR) << "ExecQueryFInstances rpc query_id=" << PrintId(query_id_) |
| 262 | << " was aborted by cancellation"; |
| 263 | status_ = Status::CANCELLED; |
| 264 | exec_done_ = true; |
| 265 | exec_status_barrier->NotifyRemaining(status_); |
| 266 | } else { |
| 267 | SetExecError( |
| 268 | FromKuduStatus(exec_rpc_status_, "Exec() rpc failed"), exec_status_barrier); |
| 269 | } |
| 270 | goto done; |
| 271 | } |
| 272 | |
| 273 | Status exec_status = StatusFromProto(exec_response_.status()); |
| 274 | if (!exec_status.ok()) { |
| 275 | SetExecError(exec_status, exec_status_barrier); |
| 276 | goto done; |
| 277 | } |
| 278 | |
| 279 | for (const auto& entry : instance_stats_map_) entry.second->stopwatch_.Start(); |
| 280 | VLOG_FILE << "rpc succeeded: ExecQueryFInstances query_id=" << PrintId(query_id_); |
| 281 | exec_done_ = true; |
| 282 | last_report_time_ms_ = GenerateReportTimestamp(); |
| 283 | exec_status_barrier->Notify(Status::OK()); |
| 284 | } |
| 285 | done: |
| 286 | // Notify after releasing 'lock_' so that we don't wake up a thread just to have it |
| 287 | // immediately block again. |
| 288 | exec_done_cv_.NotifyAll(); |
| 289 | } |
| 290 | |
| 291 | void Coordinator::BackendState::ExecAsync(const DebugOptions& debug_options, |
| 292 | const FilterRoutingTable& filter_routing_table, |
nothing calls this directly
no test coverage detected