GH-3099: Parse Redis INFO output without using Properties.load()#3382
Open
won-seoop wants to merge 1 commit into
Open
GH-3099: Parse Redis INFO output without using Properties.load()#3382won-seoop wants to merge 1 commit into
won-seoop wants to merge 1 commit into
Conversation
…ies.load() Properties.load() interprets \u sequences as Unicode escapes, which breaks when Redis INFO output contains Windows-style paths (e.g. C:\Users\...\AppData). The Redis INFO format is a simple key:value text format, not a Java .properties file. Replace the Properties.load()-based parsing with a direct line-by-line parser that: - Skips blank lines and section comments (# prefix) - Splits each line on the first colon only - Does not interpret any escape sequences This fixes parsing of Redis INFO output on Windows where the exe_path, config_file, rdb_filename, etc. entries contain backslash-u sequences. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Closes #3099. Closes #3020.
Properties.load()interprets\usequences as Unicode escapes. Redis INFO output can contain Windows-style paths in fields likeexe_path,config_file,rdb_filename, andaof_filenamethat include sequences such asc:\users\.... When these paths pass throughProperties.load(), the\uprefix triggers a Unicode parsing error (or silently corrupts the value).The Redis INFO format is a simple
key:valuetext format — it is not a Java.propertiesfile and should not be parsed as one.Changes
Fixes #3099: Replaced the
Properties.load()-based implementation inConverters.toProperties(String)with a direct line-by-line parser that:# Server,# Memory, etc.)key:valueformat)Fixes #3020:
StringToPropertiesConverternow delegates toConverters.toProperties(String)rather than duplicating the parsing logic, eliminating the duplication flagged in that issue.Test plan
c:\users\...paths (Windows Redis) is parsed without error🤖 Generated with Claude Code