From 0eed906e01530b8ce7541954bc0f171df6133a0e Mon Sep 17 00:00:00 2001 From: Eric Bowden Date: Fri, 1 May 2026 10:55:49 -0500 Subject: [PATCH] Run agent invokers in AeronArchive AsyncConnect.Poll to match Java API and avoid hangs --- src/Adaptive.Archiver/AeronArchive.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Adaptive.Archiver/AeronArchive.cs b/src/Adaptive.Archiver/AeronArchive.cs index cf6f4d7..69582a4 100644 --- a/src/Adaptive.Archiver/AeronArchive.cs +++ b/src/Adaptive.Archiver/AeronArchive.cs @@ -3325,6 +3325,28 @@ public AgentInvoker AgentInvoker() return agentInvoker; } + internal int RunInvokers() + { + int workCount = 0; + + Aeron.Aeron aeronClient = AeronClient(); + if (null != aeronClient) + { + AgentInvoker conductorAgentInvoker = aeronClient.ConductorAgentInvoker; + if (null != conductorAgentInvoker) + { + workCount += conductorAgentInvoker.Invoke(); + } + } + + if (null != agentInvoker) + { + workCount += agentInvoker.Invoke(); + } + + return workCount; + } + /// /// Get the to be used for authentication with the archive. /// @@ -3577,6 +3599,7 @@ public AsyncConnectState State() public AeronArchive Poll() { CheckDeadline(); + ctx.RunInvokers(); if (AsyncConnectState.ADD_PUBLICATION == state) {