Files
seaweedFS/weed
Mariano Ntrougkas fa025dc96f ♻️ refactor(worker): decouple state management using command-query pattern (#7354)
* ♻️ refactor(worker): decouple state management using command-query pattern

This commit eliminates all uses of sync.Mutex across the `worker.go` and `client.go`
components, changing how mutable state is accessed and modified. Single Owner
Principle is now enforced.

- Guarantees thread safety and prevents data races by ensuring that only one goroutine
ever modifies or reads state.

Impact: Improves application concurrency, reliability, and maintainability by isolating state
concerns.

* 🐛 fix(worker): fix race condition when closing

The use of select/default is wrong for mandatory shutdown signals.

* 🐛 fix(worker): do not get tickers in every iteration

* 🐛 fix(worker): fix race condition when closing pt 2

refactor `handleOutgoing` to mirror the non-blocking logic of `handleIncoming`

* address comments

* To ensure stream errors are always processed, the send should be blocking.

* avoid blocking the manager loop while waiting for tasks to complete

---------

Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Chris Lu <chris.lu@gmail.com>
2025-10-22 16:16:46 -07:00
..
2025-10-17 20:49:47 -07:00
2025-10-13 18:05:17 -07:00
2025-10-13 18:05:17 -07:00
2025-08-31 23:31:28 -07:00
2025-08-22 01:15:42 -07:00
2025-10-17 20:49:47 -07:00
2024-06-25 09:18:11 -07:00
2025-10-13 18:05:17 -07:00
2025-08-30 11:15:48 -07:00
2024-02-14 08:26:38 -08:00
2025-10-20 23:47:11 -07:00
2025-10-13 18:05:17 -07:00
2025-07-19 21:43:34 -07:00
2025-03-17 23:13:27 -07:00