fix(redis): cleanup access pattern across callsites#2289
fix(redis): cleanup access pattern across callsites#2289waleedlatif1 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR implements a comprehensive cleanup of Redis access patterns across the codebase to eliminate non-deterministic behavior and fix distributed locking issues. The main changes include:
The changes ensure predictable system behavior by making storage decisions at configuration time rather than runtime, improving reliability in distributed environments. Important Files Changed
Confidence score: 4/5
Sequence DiagramsequenceDiagram
participant User
participant NotificationPollAPI as "GET /api/notifications/poll"
participant CronAuth as "verifyCronAuth"
participant Redis as "Redis Lock Service"
participant InactivityPoller as "pollInactivityAlerts"
User->>NotificationPollAPI: "GET /api/notifications/poll"
NotificationPollAPI->>CronAuth: "verifyCronAuth(request)"
alt Auth Failed
CronAuth-->>NotificationPollAPI: "Return auth error"
NotificationPollAPI-->>User: "Return error response"
end
NotificationPollAPI->>Redis: "acquireLock(LOCK_KEY, requestId, 120)"
alt Lock Already Held
Redis-->>NotificationPollAPI: "false (lock not acquired)"
NotificationPollAPI-->>User: "Return 202 - Polling already in progress"
else Lock Acquired
Redis-->>NotificationPollAPI: "true (lock acquired)"
NotificationPollAPI->>InactivityPoller: "pollInactivityAlerts()"
InactivityPoller-->>NotificationPollAPI: "Return polling results"
NotificationPollAPI-->>User: "Return 200 - Polling completed"
end
NotificationPollAPI->>Redis: "releaseLock(LOCK_KEY, requestId)"
Redis-->>NotificationPollAPI: "Lock released"
|
|
@greptile |
* feat(folders): add the ability to create a folder within a folder in popover (#2287) * fix(agent): filter out empty params to ensure LLM can set tool params at runtime (#2288) * fix(mcp): added backfill effect to add missing descriptions for mcp tools (#2290) * fix(redis): cleanup access pattern across callsites (#2289) * fix(redis): cleanup access pattern across callsites * swap redis command to be non blocking * improvement(log-details): polling, trace spans (#2292) --------- Co-authored-by: Vikhyath Mondreti <[email protected]> Co-authored-by: Emir Karabeg <[email protected]>
Summary
Cleanup access pattern across codebase for redis client.
Type of Change
Testing
Tested with @waleedlatif1
Checklist