Skip to content

Commit 1e8ec90

Browse files
dantengskyBohuTANG
andcommitted
chore: improve license validation log message (#17967)
* chore: improve license validation log message Change license validation error log to ERROR level. Several enterprise features don't affect functional correctness but impact performance significantly. Users have experienced unexplained performance degradation due to expired licenses. This change helps users identify such issues faster. * improve the license error message * tweak log msg --------- Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
1 parent d785def commit 1e8ec90

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/query/service/src/interpreters/interpreter.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use databend_common_exception::ErrorCode;
2828
use databend_common_exception::Result;
2929
use databend_common_exception::ResultExt;
3030
use databend_common_expression::SendableDataBlockStream;
31+
use databend_common_license::license_manager::get_license_manager;
3132
use databend_common_pipeline_core::always_callback;
3233
use databend_common_pipeline_core::processors::PlanProfile;
3334
use databend_common_pipeline_core::ExecutionInfo;
@@ -91,6 +92,20 @@ pub trait Interpreter: Sync + Send {
9192

9293
ctx.set_status_info("building pipeline");
9394
ctx.check_aborting().with_context(make_error)?;
95+
96+
match get_license_manager()
97+
.manager
98+
.parse_license(ctx.get_license_key().as_str())
99+
{
100+
Ok(_) => (),
101+
Err(e) => {
102+
log::error!(
103+
"[Interpreter] CRITICAL ALERT: License validation FAILED - enterprise features DISABLED, System may operate in DEGRADED MODE with LIMITED CAPABILITIES and REDUCED PERFORMANCE. Please contact us at https://www.databend.com/contact-us/ or email hi@databend.com to restore full functionality: {}",
104+
e
105+
);
106+
}
107+
};
108+
94109
if self.is_ddl() {
95110
CommitInterpreter::try_create(ctx.clone())?
96111
.execute2()
@@ -175,7 +190,7 @@ fn log_query_start(ctx: &QueryContext) {
175190
}
176191

177192
if let Err(error) = InterpreterQueryLog::log_start(ctx, now, None) {
178-
error!("interpreter.start.error: {:?}", error)
193+
error!("[Interpreter] Query start logging failed: {:?}", error)
179194
}
180195
}
181196

@@ -192,7 +207,7 @@ fn log_query_finished(ctx: &QueryContext, error: Option<ErrorCode>, has_profiles
192207
}
193208

194209
if let Err(error) = InterpreterQueryLog::log_finish(ctx, now, error, has_profiles) {
195-
error!("interpreter.finish.error: {:?}", error)
210+
error!("[Interpreter] Query finish logging failed: {:?}", error)
196211
}
197212
}
198213

0 commit comments

Comments
 (0)