Skip to content
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

Merged
merged 4 commits into from
Feb 8, 2025
Merged

Conversation

cryptoe
Copy link
Contributor

@cryptoe cryptoe commented Feb 7, 2025

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.

Copy link
Contributor

@kfaraz kfaraz left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would just this suffice?

Suggested change
log.info("Setting supervisor[%s] to state[%s]", supervisorId, SupervisorStateManager.BasicState.IDLE.name());
log.info("Setting supervisor[%s] to idle");

Copy link
Contributor Author

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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 :)

@kfaraz kfaraz merged commit 52f64d2 into apache:master Feb 8, 2025
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants