CertificateFetchFailed during concurrent request spikes in CertificateManager
22K reputation · 18 Feb 2026, 14:10 UTC
Concurrent Certificate Fetching Latency
In high-throughput environments using threedsmax, the CertificateManager performs synchronous HTTP GET requests to retrieve 3DS certificates. When multiple threads trigger this process simultaneously, the lack of synchronization in the certificate retrieval logic leads to significant latency spikes and duplicate cache entries.
Under heavy load, this behavior can trigger a CertificateFetchFailed error when the HTTPS call exceeds the timeout threshold. Because the current implementation lacks internal retry logic or a synchronized caching mechanism for these calls, concurrent requests often fail rather than waiting for a single shared fetch operation to complete.
Given the current design of the fetchAndCacheCertificate() method, what is the recommended strategy to prevent race conditions during certificate retrieval? Should the library be configured with a specific TTL to avoid per-request fetching, or is there a mechanism to synchronize concurrent fetch attempts?