-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing logging in supervisor. #17702
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggestions
@@ -1692,12 +1692,11 @@ public void runInternal() | |||
// if suspended, ensure tasks have been requested to gracefully stop | |||
if (stateManager.getSupervisorState().getBasicState().equals(SupervisorStateManager.BasicState.STOPPING)) { | |||
// if we're already terminating, don't do anything here, the terminate already handles shutdown | |||
log.info("[%s] supervisor is already stopping.", dataSource); | |||
log.debug("[%s] supervisor is already stopping.", dataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.debug("[%s] supervisor is already stopping.", dataSource); | |
log.debug("Supervisor[%s] is already stopping.", dataSource); |
} else if (stateManager.isIdle()) { | ||
log.info("[%s] supervisor is idle.", dataSource); | ||
log.debug("[%s] supervisor is idle.", dataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.debug("[%s] supervisor is idle.", dataSource); | |
log.debug("Supervisor[%s] is idle.", dataSource); |
} else if (!spec.isSuspended()) { | ||
log.info("[%s] supervisor is running.", dataSource); | ||
|
||
log.debug("[%s] supervisor is running.", dataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.debug("[%s] supervisor is running.", dataSource); | |
log.debug("Supervisor[%s] is running.", dataSource); |
@@ -3718,7 +3717,15 @@ && computeTotalLag() == 0) { | |||
if (!idle) { | |||
stateManager.maybeSetState(SupervisorStateManager.BasicState.RUNNING); | |||
} else if (!stateManager.isIdle() && idleTime > idleConfig.getInactiveAfterMillis()) { | |||
log.info("Setting supervisor[%s] to state[%s]", supervisorId, SupervisorStateManager.BasicState.IDLE.name()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would just this suffice?
log.info("Setting supervisor[%s] to state[%s]", supervisorId, SupervisorStateManager.BasicState.IDLE.name()); | |
log.info("Setting supervisor[%s] to idle"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could but I like the original message better :).
stateManager.maybeSetState(SeekableStreamSupervisorStateManager.SeekableStreamState.CREATING_TASKS); | ||
createNewTasks(); | ||
} else { | ||
log.info("[%s] supervisor is suspended.", dataSource); | ||
log.info("Supervisor for datasource[%s] is suspended.", dataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had you intended to make this log debug too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not earlier but now I do :)
The overlord logs the status of each supervisor every second. So if we have 1000 supervisor, we log 1000 lines per second which seems redundant.
Adjusted the log levels to debug for these status logs.