Skip to content

Exception on handling event causes SqlSubscription to stop without unsubscribing #407

@wpavelev

Description

@wpavelev

Hello everyone.
We are having some issues with subscriptions using SQL Server eventstore. The error occurs when our EventHandler throws an exception. In our case it was a ServerTimeoutException for our ReadModel database.

To reproduce

  • create a SqlServerAllStreamSubscription
  • register an Eventhandler set options.ThrowOnError = true
  • register an On method or override the HandleEvent method that should throw an exception
  • add an event to the eventstore that should throw the exception
  • in your log output you will see two entries:
    • Message handling failed at AsyncHandlingFilter for message ...
    • Message V1.MyMessage not acknowledged at ... Exception
  • Add the same message another time or another message
  • there are no additional logs showing the unsubscribe, re-subscribe or further message handling

Expected behaviour
There should be log entries showing the unsubscribe and re-subscribe and another attempt to handle the event

Additional context

There may be a problem on the ChannelWorker that provides the Channel.Read delegate and the ChannelWorkerBase with Task.Run(...). The exception does not seem to be passed to the next layer.

best regards

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions