akkadotnet / Alpakka

Akka Streams Connectors - Alpakka
https://alpakka.getakka.net/
Apache License 2.0
110 stars 40 forks source link

IndexOutOfRangeException happens when trying to get the queue message #1162

Open rmt2021 opened 2 years ago

rmt2021 commented 2 years ago

Version Information 3d881af4f4831cb33a319aeda95ed13ceb61da5c

Describe the bug

When using SendNext method to send a message to the queue based on Azure Queue service, it may encounter transient errors (e.g., 503). So the Queue SendMessageAsync called inside will fail. However, it may not fail immediately but will fail at the ReceiveMessageAsync when trying to get the message, and a System.IndexOutOfRangeException will appear.

To Reproduce

We found the test Akka.Streams.Azure.StorageQueue.Tests.QueueSinkSpec.A_QueueSink_should_skip_failing_messages_if_supervision_strategy_is_restart which exercises the SendMessageAsync and ReceiveMessageAsync could be used to reproduce. Stack trace:

...
System.IndexOutOfRangeException : Index was outside the bounds of the array.
at Akka.Streams.Azure.StorageQueue.Tests.QueueSinkSpec.A_QueueSink_should_skip_failing_messages_if_supervision_strategy_is_restart() in C:\Users\Ze\Alpakka\src\Azure\Akka.Streams.Azure.StorageQueue.Tests\QueueSinkSpec.cs:line 88
...

Environment Windows

Arkatufus commented 2 years ago

@rmt2021 What are the steps that you took to reproduce the bug?

Aaronontheweb commented 2 years ago

So it's actually the Source that is failing here by the sound of it? But there's no source inside our own adapter that could throw an IndexOutOfRangeException? Isn't this error coming from inside the Azure Storage Queues driver itself?

Arkatufus commented 2 years ago

@rmt2021 are you still having this problem?