Summary
IEventSubscriptionAgentFamily.FindAgentUriAsync(shardIdentity, tenantId, ct) returns null when there is no live (running) agent for the shard. That makes it impossible to resolve — and therefore pause/restart/rebuild — a projection whose agent is registered but not currently running (paused, stopped, crashed, or in the startup window before agents start).
Why it matters
CritterWatch's admin commands (PauseProjectionHandler, RestartProjectionHandler, RebuildProjectionHandler) all resolve the real agent URI via FindAgentUriAsync (they must not hand-compose the URI). When an operator tries to recover a stopped/orphaned async projection — exactly the situation where Restart/Rebuild is most needed — FindAgentUriAsync returns null and the command no-ops (Restart/Rebuild return a "No live agent" result; Pause silently returns).
This also appears to be the root of a flaky pause→restart round-trip: a paused agent may no longer count as "live", so the subsequent restart can't find it to clear the pause restriction.
Reported downstream as CritterWatch ProductSupport #18/#19/#20 (projection Pause/Restart/Rebuild "do nothing" on an Orphaned/Continuous projection) and tracked alongside CritterWatch's own flaky can_pause_and_restart_a_projection integration test.
Ask
Provide a way to resolve the agent URI for a registered subscription/projection shard regardless of its current run state — e.g. FindAgentUriAsync consulting the registered subscription set (not just live agents), or a sibling FindRegisteredAgentUriAsync. That would let an operator restart/rebuild a projection that isn't currently running, which is the whole point of those operations.
Repro sketch
- Register an async projection; let it create a progression row.
- Stop/pause its agent (or query during the pre-start window).
- Call
FindAgentUriAsync(shardIdentity, null, ct) → returns null though the projection is registered.
Summary
IEventSubscriptionAgentFamily.FindAgentUriAsync(shardIdentity, tenantId, ct)returns null when there is no live (running) agent for the shard. That makes it impossible to resolve — and therefore pause/restart/rebuild — a projection whose agent is registered but not currently running (paused, stopped, crashed, or in the startup window before agents start).Why it matters
CritterWatch's admin commands (
PauseProjectionHandler,RestartProjectionHandler,RebuildProjectionHandler) all resolve the real agent URI viaFindAgentUriAsync(they must not hand-compose the URI). When an operator tries to recover a stopped/orphaned async projection — exactly the situation where Restart/Rebuild is most needed —FindAgentUriAsyncreturns null and the command no-ops (Restart/Rebuild return a "No live agent" result; Pause silently returns).This also appears to be the root of a flaky pause→restart round-trip: a paused agent may no longer count as "live", so the subsequent restart can't find it to clear the pause restriction.
Reported downstream as CritterWatch ProductSupport #18/#19/#20 (projection Pause/Restart/Rebuild "do nothing" on an Orphaned/Continuous projection) and tracked alongside CritterWatch's own flaky
can_pause_and_restart_a_projectionintegration test.Ask
Provide a way to resolve the agent URI for a registered subscription/projection shard regardless of its current run state — e.g.
FindAgentUriAsyncconsulting the registered subscription set (not just live agents), or a siblingFindRegisteredAgentUriAsync. That would let an operator restart/rebuild a projection that isn't currently running, which is the whole point of those operations.Repro sketch
FindAgentUriAsync(shardIdentity, null, ct)→ returns null though the projection is registered.