Skip to content

Commit

Permalink
Use independent config like apache#39015
Browse files Browse the repository at this point in the history
  • Loading branch information
liulijia committed Sep 20, 2024
1 parent 4dad4b8 commit 3ec756f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,10 @@ public class Config extends ConfigBase {
@ConfField
public static long lock_reporting_threshold_ms = 500L;

@ConfField(mutable = true, description = {"表示最大锁持有时间,超过该时间会打印告警日志,单位秒",
"Maximum lock hold time; logs a warning if exceeded"})
public static long max_lock_hold_threshold_seconds = 10L;

/**
* If false, when select from tables in information_schema database,
* the result will not contain the information of the table in external catalog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public boolean writeLockIfExist() {

private void checkAndLogLockDuration(String type, long lockStart, long lockEnd) {
long duration = lockEnd - lockStart;
if (duration > Config.lock_reporting_threshold_ms) {
if (duration > Config.max_lock_hold_threshold_seconds * 1000) {
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append(getId())
.append(" ")
Expand Down

0 comments on commit 3ec756f

Please sign in to comment.