Skip to content

[edge case] Error during reconnect if the stream in the meantime is delete #335

Closed
@Gsantomaggio

Description

@Gsantomaggio

Describe the bug

This bug occurs when a stream is deleted while the Consumer is trying to re-connect.
In most of case it works because the Metadata does the check.

but during the check and restart of the consumer, the stream could be deleted. [here the edge case]

Unhandled exception. RabbitMQ.Stream.Client.CreateConsumerException: consumer could not be created code: StreamDoesNotExist
   at RabbitMQ.Stream.Client.StreamSystem.CreateRawConsumer(RawConsumerConfig rawConsumerConfig, ILogger logger) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/StreamSystem.cs:line 441
   at RabbitMQ.Stream.Client.Reliable.ConsumerFactory.StandardConsumer(Boolean boot) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ConsumerFactory.cs:line 80
   at RabbitMQ.Stream.Client.Reliable.ConsumerFactory.CreateConsumer(Boolean boot) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ConsumerFactory.cs:line 33
   at RabbitMQ.Stream.Client.Reliable.Consumer.CreateNewEntity(Boolean boot) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/Consumer.cs:line 186
   at RabbitMQ.Stream.Client.Reliable.ReliableBase.Init(Boolean boot, IReconnectStrategy reconnectStrategy) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ReliableBase.cs:line 89
   at RabbitMQ.Stream.Client.Reliable.ReliableBase.Init(IReconnectStrategy reconnectStrategy) in //rabbitmq-stream-dotnet-client/RabbitMQ.Stream.Client/Reliable/ReliableB

Reproduction steps

  1. Run multi consumers
  2. Delete the streams

Most of the time it works but it could happen that the stream is deleted just after the check streamExist

...

Expected behavior

Close the consumer.
Need to check the error code: ConsumerFactory::StandardConsumer When it is not the first boot. If there is an error just close the consumer.

Same for Producer

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions