Skip to content

MINOR: Move Log4jControllerRegistration to server module#22779

Open
majialoong wants to merge 3 commits into
apache:trunkfrom
majialoong:move_Log4jControllerRegistration
Open

MINOR: Move Log4jControllerRegistration to server module#22779
majialoong wants to merge 3 commits into
apache:trunkfrom
majialoong:move_Log4jControllerRegistration

Conversation

@majialoong

@majialoong majialoong commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Move Log4jControllerRegistration from core to the server module.

Reviewers: Mickael Maison mickael.maison@gmail.com, Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions Bot added triage PRs from the community core Kafka Broker small Small PRs labels Jul 7, 2026

@mimaison mimaison left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR. I left a question

Comment on lines +46 to +47
} else {
LOGGER.warn("Couldn't register `{}` MBean", MBEAN_NAME);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if we actually need this branch. When registerMBean() returns false it already prints an error message with a similar message. It seems the previous catch clause in the Scala code was unreachable as registerMBean() can't throw.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review.

Good point. Utils.registerMBean already catches registration failures and logs them internally, so the previous Scala catch block was effectively unreachable. I agree that the extra warning is redundant, so I'll remove this branch.

@github-actions github-actions Bot removed the triage PRs from the community label Jul 9, 2026

@chia7712 chia7712 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

protected var logIdent: String = _

Log4jControllerRegistration
Log4jControllerRegistration.register()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering whether this is the best class to call Log4jControllerRegistration.register()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants