Conversation
WalkthroughUpdated LTS multi-cloud Redis helpers to use field-based environment access, and added a TTL helper that retries on the secondary LTS Redis when the primary lookup returns ChangesLTS Redis multi-cloud helpers
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/mobility-core/src/Kernel/Storage/Hedis/Queries.hs`:
- Around line 358-363: The fallback path in runInMultiCloudLTSRedisForTTL is
hiding secondary lookup errors by returning primaryResult after a Left err,
which can make a cross-cloud failure look like a normal TTL miss. Update the
logic in this branch so that secondary read failures are surfaced distinctly
instead of collapsing to the primary result/-2, and keep the existing logging in
place to identify the failure source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2b37a19a-f0c4-41f8-843c-c38c554b3875
📒 Files selected for processing (1)
lib/mobility-core/src/Kernel/Storage/Hedis/Queries.hs
| withTryCatch "runInMultiCloudLTSRedisForTTL" $ | ||
| local (\env -> env{hedisEnv = secondaryEnv, hedisClusterEnv = secondaryEnv}) action | ||
| case secondaryResult of | ||
| Left err -> do | ||
| logError $ "MULTI_CLOUD_LTS: Secondary read failed " <> show err | ||
| pure primaryResult |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Don't collapse secondary lookup failures into -2.
When the fallback read errors, pure primaryResult reports "key not found" even though the cross-cloud lookup actually failed. That makes transient secondary outages indistinguishable from a real TTL miss and can drive incorrect caller behavior.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@lib/mobility-core/src/Kernel/Storage/Hedis/Queries.hs` around lines 358 -
363, The fallback path in runInMultiCloudLTSRedisForTTL is hiding secondary
lookup errors by returning primaryResult after a Left err, which can make a
cross-cloud failure look like a normal TTL miss. Update the logic in this branch
so that secondary read failures are surfaced distinctly instead of collapsing to
the primary result/-2, and keep the existing logging in place to identify the
failure source.
…ature
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Checklist
./dev/format-all-files.shSummary by CodeRabbit
New Features
Bug Fixes