Unmasking a hidden singleton

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

A load test on monday.com's AI Reports feature revealed a critical race condition caused by a hidden singleton pattern. When multiple users simultaneously generated reports, a WorkdocsAPIService registered as a singleton shared mutable state across concurrent requests, causing workdoc IDs to override each other and trigger 400 errors. The bug remained undetected in production due to low adoption rates and high pod count, which minimized collision probability. The investigation traced through multiple hypotheses before discovering the singleton registration issue, highlighting the importance of load testing, end-to-end concurrent testing, and preferring stateless class designs in asynchronous environments.

6m read timeFrom engineering.monday.com
Post cover image
Table of contents
Setting the stageLoad testsThe smoking gunRabbit holes, dead ends, and the “aha!”Why didn’t we see this sooner?Takeways

Sort: