mirror of
https://github.com/Gouryella/drip.git
synced 2026-02-23 21:00:44 +00:00
A CAS loop is used to implement atomic operations on the global tunnel counter, avoiding race conditions. Add a rollback mechanism to ensure that the occupied counter resources are properly released when registration fails. Concurrency safety for IP rate limiting is achieved by using atomic operations and locks in combination. Add appropriate resource rollback logic at each faulty branch to prevent resource leaks.