autopilot: don't fetch DB while holding the lock#4604
Conversation
…e outside of lock
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
Code Review
This pull request refactors the cache locking mechanism in solvable_orders.rs by wrapping the lock acquisition and query building inside a block. This ensures that the cache lock is dropped before the fetch_orders future is awaited, preventing potential lock contention or deadlocks. No critical issues were found, and there is no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
I have read the CLA Document and I hereby sign the CLA |
Description
While scoping the repo I noticed that this particular comment was contradicting the actual code.
get_solvable_ordersacquired the cache Mutex and held the guard across the DB fetch, instead of awaiting without a lock.Changes
Scope the guard to a block so it's released the instant the future is built.
How to test
Tests from
autopilotcrate are passing, the behavior is preserved - identicalSolvableOrdersare returned. Only the guard's lifetime shrank.Related Issues
Fixes #