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

Method HandleOutboundCallTimeout

be/src/kudu/rpc/connection.cc:382–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380}
381
382void Connection::HandleOutboundCallTimeout(CallAwaitingResponse *car) {
383 DCHECK(reactor_thread_->IsCurrentThread());
384 if (!car->call) {
385 // The RPC may have been cancelled before the timeout was hit.
386 return;
387 }
388 // The timeout timer is stopped by the car destructor exiting Connection::HandleCallResponse()
389 DCHECK(!car->call->IsFinished());
390
391 // Mark the call object as failed.
392 car->call->SetTimedOut(negotiation_complete_ ? Phase::REMOTE_CALL
393 : Phase::CONNECTION_NEGOTIATION);
394
395 // Test cancellation when 'car->call' is in 'TIMED_OUT' state
396 MaybeInjectCancellation(car->call);
397
398 // Drop the reference to the call. If the original caller has moved on after
399 // seeing the timeout, we no longer need to hold onto the allocated memory
400 // from the request.
401 car->call.reset();
402
403 // We still leave the CallAwaitingResponse in the map -- this is because we may still
404 // receive a response from the server, and we don't want a spurious log message
405 // when we do finally receive the response. The fact that CallAwaitingResponse::call
406 // is a NULL pointer indicates to the response processing code that the call
407 // already timed out.
408}
409
410void Connection::CancelOutboundCall(const shared_ptr<OutboundCall> &call) {
411 CallAwaitingResponse* car = FindPtrOrNull(awaiting_response_, call->call_id());

Callers 1

HandleTimeoutMethod · 0.80

Calls 4

IsFinishedMethod · 0.80
SetTimedOutMethod · 0.80
resetMethod · 0.65
IsCurrentThreadMethod · 0.45

Tested by

no test coverage detected