Repository navigation
fix: Sentinel startup NPE + UTF-8 Redis key encoding (v1.8) - #14
Merged
Merged
Conversation
P1-1: initializeConfigParams() called sentinels.isEmpty() on a value that is null whenever TOMCAT_REDIS_SESSION_SENTINEL_MASTER is set but TOMCAT_REDIS_SESSION_SENTINELS is not, throwing NPE out of startInternal() and preventing Tomcat from booting. Add an explicit null check. M1: all Redis key operations (set/get/exists/ttl/expire) and the NULL_SESSION sentinel encoded keys with String.getBytes() using the platform-default charset, risking key-byte mismatches between cluster nodes with different default charsets. Pin every encoding to StandardCharsets.UTF_8. Bumps version 1.7 -> 1.8. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Codex Autonomous Review:
I did not find a concrete regression introduced by this patch in the changed code paths. The Sentinel null check removes a startup failure, and the UTF-8 key updates remain compatible with the Jedis APIs used in this repository. The project also compiles successfully after the change. Tip: comment with "/codex address comments" to attempt automated fixes for unresolved review threads. |
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.
Two low-risk fixes from the code review.
P1-1 — NullPointerException at startup with Sentinel master set
initializeConfigParams()didsentinels.isEmpty()wheresentinelsisnullwheneverTOMCAT_REDIS_SESSION_SENTINEL_MASTERis set butTOMCAT_REDIS_SESSION_SENTINELSis not. The NPE propagates out ofstartInternal()as aLifecycleException, so Tomcat fails to boot. Fixed with an explicit null check:M1 — Redis keys encoded with platform-default charset
All key operations (
set/get/exists/ttl/expire) and theNULL_SESSIONconstant usedString.getBytes()with no charset, i.e. the JVM default. Two cluster nodes with different default charsets could derive different key bytes for the same session and fail to find each other's data. Low real-world risk (session IDs are ASCII), but a latent cross-node bug. All encodings now pinned toStandardCharsets.UTF_8.Bumps version 1.7 → 1.8.
🤖 Generated with Claude Code