Galaxy: wait on the gateway's stream-attached ack instead of the 1 s best-effort wait (mxaccessgw#227) #877
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mxaccessgw#227 (main afd504d5) adds an opt-in attach acknowledgement on StreamEvents, closing the race from #865. Not yet on the feed — blocked on an mxgw Client/Contracts release.
Changes needed:
Done on master
f264977f. MxGateway Client/Contracts 0.3.0 → 0.4.0 (nupkgs committed to ./nuget-packages, as with prior bumps). GatewayGalaxySubscriber requests emit_stream_attached only when the session advertises stream-events-attached-ack; EventPump intercepts StreamAttached (never dispatched or counted; new counter galaxy.events.stream_attached; the signal also completes when the stream ends so waiters can't hang); AwaitCurrentEventStreamAsync waits on the ack within the existing 1 s StreamRequestWait budget, and logs a rate-limited Warning and proceeds if the ack is missing; older gateways keep the StreamRequested fallback. Each reconnect's new pump gets a fresh signal.Tests: 6 new StreamAttachedAckTests (3 fail with the wait disabled); Driver.Galaxy 580/0, Galaxy.Browser 24/0, Core.Abstractions 728/0; full solution builds clean. Not covered by a unit test: the request flag reaching a real gateway. Verify on the next deploy against an mxgw at >= afd504d5 (DEV vd03's gateway is 2b13564e, older; vd03 OtOpcUa has no Galaxy driver anyway). No deployment.
Live-verified 2026-11-12 on windev (mxgw upgraded 8cb8fcdf → main 447070a5, Server + x86 Worker; backup C:\publish\mxaccessgw-backup-20261112-pre447070a5). New durable LiveIntegration test on master
a28adba2: GatewayGalaxyStreamAttachedAckLiveTests (MXGW_ENDPOINT + GALAXY_MXGW_API_KEY), 4/4 against http://10.100.0.48:5120:Mutation controls on live: subscriber not requesting → fails; driver not waiting → fails 2/2 (wire order became stream → subscribe → ack, so the race is real); pump dispatching the ack → fails.
Existing Galaxy live tests vs the upgraded gateway: ReopenAndWrite 5/5; WriteMeter 3/3 filtered (fails only in a full parallel run, per its own doc); AlarmFeed fails only because windev has 0 active alarms.