#34820 [Bug]: spend rows popped from the queue are lost when a flush is cancelled
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Spend rows are removed from the in-memory queue before the database write is awaited, so any cancellation of a flush loses them permanently. There is no requeue and no shielding.
`update_spend_logs_job` pops the batch under `_spend_log_transactions_lock` and reassigns the remainder (litellm/proxy/utils.py:5549-5554), then awaits `ProxyUpdateSpend.update_spend_logs`. If that await is cancelled or fails, the rows are gone: the handler carries an explicit `except Exception: # Logs already removed from queue at start - don't put them back` (litellm/proxy/utils.py:5420), and `asyncio.CancelledError` is not an `Exception` subclass, so a cancellation is not even logged there.
Two live cancellation paths reach this code:
1. `scheduler.shutdown()` -- apscheduler's `AsyncIOExecutor.shutdown()` states in its own source that it cannot honor `wait=True` and cancels pending job coroutines, so a mid-flight `update_spend` run is aborted. 2. `_monitor_spend_logs_queue` is started as a bare `asyncio.create_task` (litellm/proxy/proxy_server.py:8042) …