Skip to content

Support space-separated key-value pairs in moduleArgs and case-insensitive arg matching#243

Merged
meiravgri merged 3 commits intomasterfrom
meiravg_fix_explicit_moduleargs_parsing
Apr 5, 2026
Merged

Support space-separated key-value pairs in moduleArgs and case-insensitive arg matching#243
meiravgri merged 3 commits intomasterfrom
meiravg_fix_explicit_moduleargs_parsing

Conversation

@meiravgri
Copy link
Copy Markdown
Contributor

@meiravgri meiravgri commented Apr 2, 2026

fix_modulesArgs didn't handle plain space-separated key-value strings like Env(moduleArgs='_FREE_RESOURCE_ON_THREAD FALSE TIMEOUT 80 WORKERS 4'). Without semicolons, the entire string was treated as a single arg with _FREE_RESOURCE_ON_THREAD as the name, making it impossible to override individual defaults.

Additionally, arg name matching between explicit args and defaults was case-sensitive, so WORKERS 4 wouldn't override a default workers 8.

Solution:

  • When a string has no semicolons and more than two words, it's now parsed as consecutive key-value pairs: 'K1 V1 K2 V2'['K1 V1', 'K2 V2'].
  • An odd number of words (without semicolons) produces a clear error explaining that semicolons are needed for args with multiple values.
  • Arg name comparison between explicit args and defaults is now case-insensitive (using .upper() normalization). The actual arg strings keep their original casing.
  • Existing semicolon-based parsing is unchanged.

2. make comparison non-case sensitve
@meiravgri meiravgri changed the title 1. fix parsing to support space seperated string Support space-separated key-value pairs in moduleArgs and case-insensitive arg matching Apr 2, 2026
@meiravgri meiravgri requested a review from ikalchev April 3, 2026 04:31
words = parts[0].split()
if len(words) % 2 != 0:
print(Colors.Bred(f"Error in args: odd number of words in key-value pairs: '{modulesArgs}'. "
f"Use semicolons to separate args with multiple values (e.g. 'KEY1 V1; KEY2 V2 V3')."))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: f-string not needed here.

@meiravgri meiravgri merged commit 0f50113 into master Apr 5, 2026
10 checks passed
@meiravgri meiravgri deleted the meiravg_fix_explicit_moduleargs_parsing branch April 5, 2026 06:53
ofiryanai added a commit to ofiryanai/RLTest that referenced this pull request Apr 8, 2026
The key-value pair splitting introduced in PR RedisLabsModules#243 changes how args are
passed to Redis loadmodule, breaking modules that expect the original
single-string format. This caused silent Redis server crashes in CI
multiprocessing workers.

Revert to pre-v0.7.22 behavior: when no semicolons are present, keep
the entire string as a single arg. The case-insensitive arg matching
from PR RedisLabsModules#243 is preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants