CosmosDB agent scheme unrecognised
Describe the bug The CosmosDbDurabilityAgent constructs its agent URI as cosmosdb://durability, but NodeAgentController only knows about the wolverinedb scheme — so findAgentAsync throws "Unrecognized agent scheme 'cosmosdb' (Parameter 'uri')" every poll cycle.
It seems to be the same pattern as a RavenDb bug fixed in #2261
To Reproduce Steps to reproduce the behavior:
- Create a Wolverine host with CosmosDB persistence:
builder.Host.UseWolverine(opt =>
{
opt.UseCosmosDbPersistence("anyDatabaseId");
opt.Durability.NodeReassignmentPollingTime = TimeSpan.FromSeconds(5); // speed up repro
});
- Start the host against any reachable Cosmos account.
- Within NodeReassignmentPollingTime, the log emits:
Error trying to reevaluate agent assignments for 'wolverinedb' agents
System.ArgumentOutOfRangeException: Unrecognized agent scheme 'cosmosdb' (Parameter 'uri')
at Wolverine.Runtime.Agents.NodeAgentController.findAgentAsync(Uri uri)
at Wolverine.Runtime.Agents.NodeAgentController.StartAgentAsync(Uri agentUri)
Version: reproduced on WolverineFx.CosmosDb 5.35.1
Expected behavior No agent assignment error when using WolverineFx.CosmosDb
StackTrace System.ArgumentOutOfRangeException: Unrecognized agent scheme 'cosmosdb' (Parameter 'uri') at Wolverine.Runtime.Agents.NodeAgentController.findAgentAsync(Uri uri) in /home/runner/work/wolverine/wolverine/src/Wolverine/Runtime/Agents/NodeAgentController.cs:line 156 at Wolverine.Runtime.Agents.NodeAgentController.StartAgentAsync(Uri agentUri) in /home/runner/work/wolverine/wolverine/src/Wolverine/Runtime/Agents/NodeAgentController.cs:line 166 at Wolverine.Runtime.Agents.NodeAgentController.startAllAgentsAsync() in /home/runner/work/wolverine/wolverine/src/Wolverine/Runtime/Agents/NodeAgentController.StartLocally.cs:line 54
Additional context Disclaimer - Claude code was used to help diagnose this issue.
@frozenskys yeah, there was a similar issue w/ RavenDb and this will get a similar fix. I'm aiming for a 5.* bug fix release with this, and it'll roll into 6.0 too