SIGN IN SIGN UP

Prevent deadlock when create a new meter/price on Stripe (#19196)

This also puts the entire state of `StripeBilling` behind a `RwLock`.
When fetching the existing prices and meters, or when inserting new
ones, we acquire a write lock and hold it until the Stripe request
completes. This prevents two concurrent calls to `get_or_insert_price`
from inserting the same data twice.

Creating a new meter/price is unusual, so in practice we'll acquire a
read lock most of the time.

/cc @rtfeldman @maxdeviant 

Release Notes:

- N/A
A
Antonio Scandurra committed
6e2869a321de7a51a970f97012f00cf3335ea06e
Parent: 6986f08
Committed by GitHub <noreply@github.com> on 10/14/2024, 3:31:51 PM