mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
AddSweep now masks cancellation races during its caller-side setup, but a request can still be accepted by the batcher run loop before the run context cancellation is selected. If handleSweeps then performs a context-sensitive store call while shutdown is in progress, a backend-specific error such as driver.ErrBadConn can still bubble out through Batcher.Run. Prefer the run context's terminal error when startup, handleSweeps, or asynchronous errChan failures happen after the run context has been canceled. This keeps normal shutdown reporting consistent and avoids surfacing backend driver errors from the accepted-request and async error paths. Log the original run-loop error before returning the context error so normal shutdown remains debuggable without changing the returned error. Add regression tests for both covered run-loop races. One lets AddSweep successfully hand a sweep request to Run, then cancels the run context from the second GetSweepStatus call while returning driver.ErrBadConn. The other queues an errChan error from the event loop while canceling the run context. Both tests assert that Run returns context.Canceled and does not wrap the driver error. |
||
|---|---|---|
| .. | ||
| greedy_batch_selection.go | ||
| greedy_batch_selection_test.go | ||
| log.go | ||
| presigned.go | ||
| presigned_test.go | ||
| store.go | ||
| store_mock.go | ||
| sweep_batch.go | ||
| sweep_batch_test.go | ||
| sweep_batcher.go | ||
| sweep_batcher_presigned_test.go | ||
| sweep_batcher_test.go | ||