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

Method LogError

be/src/runtime/runtime-state.cc:190–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190bool RuntimeState::LogError(const ErrorMsg& message, int vlog_level) {
191 lock_guard<SpinLock> l(error_log_lock_);
192 // All errors go to the log. If the amount of errors logged to vlog level 1 exceed
193 // or equal max_error_logs_per_instance, then that error will be downgraded to vlog
194 // level 2.
195 int user_max_errors = query_options().max_errors;
196 if (vlog_level == 1 && user_max_errors >= 0
197 && vlog_1_errors >= FLAGS_max_error_logs_per_instance) {
198 vlog_level = 2;
199 }
200
201 if (VLOG_IS_ON(vlog_level)) {
202 VLOG(vlog_level) << "Error from query " << PrintId(query_id()) << ": "
203 << message.msg();
204 }
205
206 if (vlog_level == 1 && user_max_errors >= 0) {
207 vlog_1_errors++;
208 DCHECK_LE(vlog_1_errors, FLAGS_max_error_logs_per_instance);
209 if (vlog_1_errors == FLAGS_max_error_logs_per_instance) {
210 VLOG(vlog_level) << "Query " << PrintId(query_id()) << " printed "
211 << FLAGS_max_error_logs_per_instance
212 << " non-fatal error to log level 1 (INFO). Further non-fatal "
213 << "error will be downgraded to log level 2 (DEBUG).";
214 }
215 }
216
217 TErrorCode::type code = message.error();
218 if (ErrorCount(error_log_) < max_errors()
219 || (code != TErrorCode::GENERAL && error_log_.find(code) != error_log_.end())) {
220 // Appending general error is expensive since it writes the entire message to the
221 // error_log_ map. Meanwhile, appending non-general (specific) error that already
222 // exist in error_log_ is cheap since it only increment count.
223 AppendError(&error_log_, message);
224 return true;
225 }
226 return false;
227}
228
229void RuntimeState::GetUnreportedErrors(ErrorLogMapPB* new_errors) {
230 new_errors->clear();

Callers 3

SendMethod · 0.45
CloseMethod · 0.45
MemLimitExceededMethod · 0.45

Calls 6

PrintIdFunction · 0.85
ErrorCountFunction · 0.85
AppendErrorFunction · 0.85
errorMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected