Skip to content

Dispatch swallows non-ARCP exceptions; peer never sees INTERNAL_ERROR #40

@nficano

Description

@nficano

Category: bug Severity: major
Location: src/Arcp.Runtime/SessionState.Dispatch.cs:40-43

What

Only ArcpException is converted into an outbound session.error; any other exception thrown while dispatching an inbound message is logged and swallowed. The peer receives no session.error{INTERNAL_ERROR} and no acknowledgement, so e.g. a job.submit that fails with an unexpected exception leaves the client waiting forever for a job.accepted that never arrives. Spec §12 defines INTERNAL_ERROR for exactly this and the dispatcher already surfaces INVALID_REQUEST for malformed input.

Evidence

catch (Exception ex)
{
    _logger.LogError(ex, "Dispatch error for type {Type}", env.Type);
}

Proposed fix

In the catch-all, send a session.error with code INTERNAL_ERROR (retryable: true) before logging, mirroring the ArcpException branch.

Acceptance criteria

  • An unexpected exception during dispatch results in an outbound session.error{INTERNAL_ERROR} to the originating peer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audit/bugAudit: bug / inefficiencysev/majorSeverity: major

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions