-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[TT-15954] Make org session expiry check non-blocking #7480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
🔍 Code Analysis ResultsThis PR introduces a non-blocking mechanism for checking organization session expiry, preventing the gateway from stalling on RPC calls to the Multi-Data Center Bridge (MDCB). This is achieved by implementing a background refresh pattern and adding a fast-path check for emergency mode. On a cache miss for an organization's session expiry, a default value is returned immediately, while a background goroutine fetches the actual value from MDCB to populate the cache for subsequent requests. Files Changed AnalysisThe changes are localized to two files:
The number of additions is substantially higher than deletions, primarily due to the comprehensive new test cases required to validate the asynchronous logic. Architecture & Impact AssessmentWhat this PR accomplishesThis PR enhances the gateway's resilience and performance by decoupling the request-processing path from the latency of synchronous RPC calls to MDCB. By making the organization session expiry check non-blocking, it ensures that slow or unavailable MDCB services do not degrade the gateway's ability to handle traffic. Key technical changes introduced
Affected system components
Flow DiagramsequenceDiagram
participant Requester
participant Gateway
participant Cache
participant MDCB (RPC)
Requester->>Gateway: API Request
Gateway->>Gateway: Analytics Handler needs Org Expiry
alt Emergency Mode Active
Gateway-->>Gateway: Return Default Expiry
else Normal Mode
Gateway->>Cache: Get expiry for org
alt Cache Hit
Cache-->>Gateway: Return cached expiry
else Cache Miss
Cache-->>Gateway: Not found
Gateway-->>Gateway: Return Default Expiry (non-blocking)
par Background Refresh
Gateway->>Gateway: go refreshOrgSessionExpiry()
Gateway->>MDCB (RPC): Get org session
MDCB (RPC)-->>Gateway: Return session data
Gateway->>Cache: Set new expiry from data
end
end
end
Gateway->>Requester: API Response
Scope Discovery & Context ExpansionThe function The continued use of Metadata
Powered by Visor from Probelabs Last updated: 2025-10-27T12:07:06.047Z | Triggered by: synchronize | Commit: e9d61cf 💡 TIP: You can chat with Visor using |
🔍 Code Analysis ResultsSecurity Issues (2)
Architecture Issues (1)
Performance Issues (1)
Quality Issues (2)
✅ Dependency Check PassedNo dependency issues found – changes LGTM. Connectivity Issues (2)
Powered by Visor from Probelabs Last updated: 2025-10-27T12:07:07.477Z | Triggered by: synchronize | Commit: e9d61cf 💡 TIP: You can chat with Visor using |
|
API Changes no api changes detected |
|



Description
This change prevents the gateway from blocking on RPC calls to MDCB during org session expiry checks.
Related Issue
TT-15954
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Ticket Details
TT-15954
Generated at: 2025-10-27 12:01:45