fix(worker): unregister-first shutdown cleanup order, guarded + logged (#175, R21-K10)
ShutdownGracefully now Unregisters every server handle first (MXAccess drops its items and advise subscriptions with it). Only for a server whose Unregister fails does the UnAdvise -> RemoveItem fallback run. Each step is guarded, logged at Debug, and the method is idempotent. #176 (AuthenticateUser cache) is unaffected. Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -228,7 +228,10 @@ Shutdown:
|
||||
|
||||
1. Mark the command queue as completing.
|
||||
2. Drain or reject pending commands according to shutdown mode.
|
||||
3. Optionally issue MXAccess cleanup calls for active handles.
|
||||
3. Issue MXAccess cleanup: `Unregister` every tracked server handle first (MXAccess removes
|
||||
its items and advise subscriptions with it). Only for a server whose `Unregister` failed,
|
||||
fall back to `UnAdvise` then `RemoveItem` over its remaining handles. Each step is
|
||||
guarded (a failure is recorded, never skips the rest) and logged at Debug (R21-K10, #175).
|
||||
4. Detach event handlers.
|
||||
5. Release COM references.
|
||||
6. Uninitialize COM.
|
||||
|
||||
Reference in New Issue
Block a user