MCPcopy Create free account
hub / github.com/apache/impala / RunThread

Method RunThread

be/src/rpc/impala-service-pool.cc:271–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void ImpalaServicePool::RunThread() {
272 while (true) {
273 std::unique_ptr<kudu::rpc::InboundCall> incoming;
274 if (!service_queue_.BlockingGet(&incoming)) {
275 VLOG(1) << "ImpalaServicePool: messenger shutting down.";
276 return;
277 }
278
279 // We need to call RecordHandlingStarted() to update the InboundCall timing.
280 incoming->RecordHandlingStarted(incoming_queue_time_.get());
281 ADOPT_TRACE(incoming->trace());
282
283 if (UNLIKELY(incoming->ClientTimedOut())) {
284 TRACE_TO(incoming->trace(), "Skipping call since client already timed out"); // NOLINT(*)
285
286 // Respond as a failure, even though the client will probably ignore
287 // the response anyway.
288 FailAndReleaseRpc(kudu::rpc::ErrorStatusPB::ERROR_SERVER_TOO_BUSY,
289 kudu::Status::TimedOut("Call waited in the queue past client deadline"),
290 incoming.release());
291 continue;
292 }
293
294 const string& method_name = incoming->remote_method().method_name();
295 int64_t transfer_size = incoming->GetTransferSize();
296 payload_size_histograms_[method_name]->Update(transfer_size);
297
298 TRACE_TO(incoming->trace(), "Handling call"); // NOLINT(*)
299 // Release the InboundCall pointer -- when the call is responded to, it will get
300 // deleted at that point.
301 service_->Handle(incoming.release());
302 }
303}
304
305const string ImpalaServicePool::service_name() const {
306 return service_->service_name();

Callers

nothing calls this directly

Calls 10

TimedOutFunction · 0.85
RecordHandlingStartedMethod · 0.80
ClientTimedOutMethod · 0.80
getMethod · 0.65
BlockingGetMethod · 0.45
traceMethod · 0.45
releaseMethod · 0.45
GetTransferSizeMethod · 0.45
UpdateMethod · 0.45
HandleMethod · 0.45

Tested by

no test coverage detected