Repository navigation
[improve] PIP-467: Convert remaining modules logging from SLF4J to slog - #25511
Merged
Merged
Conversation
dao-jun
approved these changes
Apr 13, 2026
lhotari
approved these changes
Apr 13, 2026
Convert remaining SLF4J-style log calls in PulsarSaslServer and AuthenticationProviderSasl to slog format. Fix .exception() calls where a String was passed instead of a Throwable.
The slog Logger has no isDebugEnabled() method. The fluent debug() API is cheap enough to not need guards, so remove them to fix compilation.
- MiniKdc: convert the loop's log.info("{}: {}", ...) to slog fluent
- ProxySaslAuthenticationTest, SaslAuthenticateTest: replace misused
.exception(stringArg) with .attr(). .exception() takes Throwable only.
The PR appended lombok.CustomLog to the end of the lombok import group in many files and into the wrong group in a few others, breaking checkstyle's ImportOrder rule. Re-sort the lombok imports so CustomLog sits in alphabetical order. Also wrap two 124-char lambda lines in PulsarWorkerRebalanceDrainTest to stay under the 120-char limit.
- ProducerHandler: guard wrap two debug calls with Consumer form so getRemote().getRemoteAddress() is only evaluated when debug is enabled. The old SLF4J code had isDebugEnabled() guards for the same reason; removing them made ProducerHandlerTest NPE because getRemote() is null in the test mock. - CmdProduce: use infof so the emitted text is "N messages successfully produced", which is what CLITest asserts on stdout. - LoggingBrokerInterceptor: use infof so the emitted text is "initialize: OK" / "beforeSendMessage: OK", matching the TestBrokerInterceptors log-grep assertions.
lhotari
added a commit
to lhotari/pulsar
that referenced
this pull request
Sep 7, 2026
…mmands Follow-up to the review on apache#26480, pulsar-client half. - `ProducerSocket.onMessage` had lost the `if (this.result != null)` guard, so a text frame arriving outside a pending send would NPE on the Jetty callback thread where it used to be ignored. Restores the guard and the pre-split log text ("Received ack" with attr `ack`); the version in the split was a hand-rendering of the pre-apache#25511 slf4j format string. Also drops the dead `throws InterruptedException` on `onConnect`, and comments the two deliberate changes in the same class: `send()` installs the completion future before `sendText(...)` (the old order let an ack complete the previous future and hang the caller for the full 30s), and `close()` null-checks the session that `onClose` clears. - `consume-v4`'s `--start-timestamp` seek and `--end-timestamp` filter were only covered by their rejection messages: deleting either line left every test passing, though timestamp seek is the stated reason the command exists. Adds `PulsarClientToolTest.testConsumeV4StartAndEndTimestamp`, which pins both against a real observed publish time. Mutation checked: deleting either line fails it. - `CmdProduceV4.nativeAvroSchemaOrNull` returned null for an Avro schema with no native definition, which would ship the raw JSON text as the payload; the pre-apache#25917 command threw. Throws again. Not reachable from any current CLI invocation, but the invariant is worth keeping explicit. - `PulsarClientTool.buildV4ClientBuilder`: removes the unreachable "proxy-protocol must be provided with proxy-url" throw — `updateConfig()` is the `preRun()` hook and already returns 1 for that case before the supplier that reaches this method is even created, and `ClientBuilderImpl` re-checks it. Keeps the outer `isNotBlank` guard, which unlike the V5 path is load-bearing here because this builder uses `loadConf()`. Documents why `serviceUrl` and `tlsTrustCertsFilePath` are applied unconditionally. - Deletes `AbstractCmdReadCommand.startMessageId()` and both overrides: never called, `webSocketStartMessageId()` is the one in use. - `TestCmdConsume` sets `subscriptionName` directly instead of reflecting into it; the field is protected and the test is in the same package. - `CmdV4CommandsTest` imports the `java.util` types its helper used inline.
2 of 14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pulsar-broker) from SLF4J to slog structured logginglog.infof()with Java format specifiers for performance tool stats output.exceptionMessage(e)consistently for logging exception messages without stack tracesTest plan
compileJavapasses for all modulesMotivation
PIP-467
Note
Please label this PR with
ready-to-test