bito-code-review[bot] commented on PR #43759: URL: https://github.com/apache/superset/pull/43759#issuecomment-5554804088
<!-- Bito Reply --> The concern regarding the lack of atomicity in the read-then-set counter is valid. Relying on a standard read-then-write operation in a distributed or multi-threaded environment can indeed lead to race conditions where concurrent requests bypass the intended query-load guard. To address this, using an atomic operation provided by your caching layer (such as Redis `INCR` or `SETNX` with an expiration) is the recommended approach. This ensures that the increment and limit check occur as a single, indivisible operation, effectively preventing the race condition described. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
