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

Method RunThread

be/src/kudu/rpc/service_pool.cc:201–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void ServicePool::RunThread() {
202 while (true) {
203 std::unique_ptr<InboundCall> incoming;
204 if (!service_queue_.BlockingGet(&incoming)) {
205 VLOG(1) << "ServicePool: messenger shutting down.";
206 return;
207 }
208
209 incoming->RecordHandlingStarted(incoming_queue_time_.get());
210 ADOPT_TRACE(incoming->trace());
211
212 if (PREDICT_FALSE(incoming->ClientTimedOut())) {
213 TRACE_TO(incoming->trace(), "Skipping call since client already timed out");
214 rpcs_timed_out_in_queue_->Increment();
215
216 // Respond as a failure, even though the client will probably ignore
217 // the response anyway.
218 incoming->RespondFailure(
219 ErrorStatusPB::ERROR_SERVER_TOO_BUSY,
220 Status::TimedOut("Call waited in the queue past client deadline"));
221
222 // Must release since RespondFailure above ends up taking ownership
223 // of the object.
224 ignore_result(incoming.release());
225 continue;
226 }
227
228 TRACE_TO(incoming->trace(), "Handling call");
229
230 // Release the InboundCall pointer -- when the call is responded to,
231 // it will get deleted at that point.
232 service_->Handle(incoming.release());
233 }
234}
235
236const string& ServicePool::service_name() const {
237 return service_->service_name();

Callers 1

InitMethod · 0.95

Calls 11

TimedOutFunction · 0.85
ignore_resultFunction · 0.85
RecordHandlingStartedMethod · 0.80
ClientTimedOutMethod · 0.80
getMethod · 0.65
BlockingGetMethod · 0.45
traceMethod · 0.45
IncrementMethod · 0.45
RespondFailureMethod · 0.45
releaseMethod · 0.45
HandleMethod · 0.45

Tested by

no test coverage detected