fix(driver-twincat): resolve Medium code-review finding (Driver.TwinCAT-009)
Swap _devices and _tagsByName to ConcurrentDictionary so ShutdownAsync Clear() no longer races concurrent TryGetValue calls; store ProbeTask on DeviceState and await it in ShutdownAsync before disposing the client and gate, eliminating the probe-disposal race. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -248,7 +248,7 @@ them on rebuild, or introduce a lifecycle lock / `volatile` running guard so rea
|
||||
with `BadServerHalted`/`BadNodeIdUnknown` once shutdown begins. Cancel and await the probe
|
||||
tasks before disposing `DeviceState`s.
|
||||
|
||||
**Resolution:** _(open)_
|
||||
**Resolution:** Resolved 2026-05-22 — swapped `_devices` and `_tagsByName` to `ConcurrentDictionary` so concurrent `TryGetValue` / `Clear` calls are safe; added `DeviceState.ProbeTask` and updated `ShutdownAsync` to cancel then `await` each probe task before disposing the client and gate, eliminating the disposal race.
|
||||
|
||||
### Driver.TwinCAT-010
|
||||
|
||||
|
||||
Reference in New Issue
Block a user