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

Method ReportExecStatus

be/src/service/control-service.cc:179–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void ControlService::ReportExecStatus(const ReportExecStatusRequestPB* request,
180 ReportExecStatusResponsePB* response, RpcContext* rpc_context) {
181 const TUniqueId query_id = ProtoToQueryId(request->query_id());
182 QueryHandle query_handle;
183 Status status =
184 ExecEnv::GetInstance()->impala_server()->GetQueryHandle(query_id, &query_handle);
185
186 // This failpoint is to allow jitter to be injected.
187 DebugActionNoFail(FLAGS_debug_actions, "REPORT_EXEC_STATUS_DELAY");
188
189 if (!status.ok()) {
190 // This is expected occasionally (since a report RPC might be in flight while
191 // cancellation is happening). Return an error to the caller to get it to stop.
192 const string& err = Substitute("ReportExecStatus(): Received report for unknown "
193 "query ID (probably closed or cancelled): $0 "
194 "remote host=$1",
195 PrintId(query_id), rpc_context->remote_address().ToString());
196 VLOG(1) << err;
197 RespondAndReleaseRpc(Status::Expected(err), response, rpc_context);
198 return;
199 }
200
201 // The runtime profile is sent as a Thrift serialized buffer via sidecar. Get the
202 // sidecar and deserialize the thrift profile if there is any. The sender may have
203 // failed to serialize the Thrift profile so an empty thrift profile is valid.
204 // TODO: Fix IMPALA-7232 to indicate incomplete profile in this case.
205 TRuntimeProfileForest thrift_profiles;
206 if (LIKELY(request->has_thrift_profiles_sidecar_idx())) {
207 const Status& profile_status =
208 GetProfile(*request, *query_handle, rpc_context, &thrift_profiles);
209 if (UNLIKELY(!profile_status.ok())) {
210 LOG(ERROR) << Substitute("ReportExecStatus(): Failed to deserialize profile "
211 "for query ID $0: $1", PrintId(query_handle->query_id()),
212 profile_status.GetDetail());
213 // Do not expose a partially deserialized profile.
214 TRuntimeProfileForest empty_profiles;
215 swap(thrift_profiles, empty_profiles);
216 }
217 }
218
219 Status resp_status = query_handle->UpdateBackendExecStatus(*request, thrift_profiles);
220 RespondAndReleaseRpc(resp_status, response, rpc_context);
221}
222
223template <typename ResponsePBType>
224void ControlService::RespondAndReleaseRpc(

Callers

nothing calls this directly

Calls 11

ProtoToQueryIdFunction · 0.85
DebugActionNoFailFunction · 0.85
SubstituteFunction · 0.85
PrintIdFunction · 0.85
GetQueryHandleMethod · 0.80
GetDetailMethod · 0.80
query_idMethod · 0.45
impala_serverMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected