| 269 | } |
| 270 | |
| 271 | void 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 | |
| 305 | const string ImpalaServicePool::service_name() const { |
| 306 | return service_->service_name(); |
nothing calls this directly
no test coverage detected