This change should reduce the frequency/severity of slow requests due to long queues forming on the lock protecting the API state.
This PR:
Uses at instead of get to manually control locking in request handlers. The changes are focused on requests which might be slow and which don't actually need a lock on the state for their whole duration
Upgrades all endpoints in the availability API which have a timeout on a Fetch so that they don't have a lock while waiting for the timeout
Refactors the sync-status endpoint to make a clone of the SQL client, and run the actual query without borrowing/locking the API state. This allows the (potentially very slow) query to proceed asynchronously from other requests and state updates
This change should reduce the frequency/severity of slow requests due to long queues forming on the lock protecting the API state.
This PR:
at
instead ofget
to manually control locking in request handlers. The changes are focused on requests which might be slow and which don't actually need a lock on the state for their whole durationFetch
so that they don't have a lock while waiting for the timeoutsync-status
endpoint to make a clone of the SQL client, and run the actual query without borrowing/locking the API state. This allows the (potentially very slow) query to proceed asynchronously from other requests and state updates