rebus-org / Rebus

:bus: Simple and lean service bus implementation for .NET
https://mookid.dk/category/rebus
Other
2.3k stars 356 forks source link

Duplicated message when using Defer #908

Closed b2yq closed 3 years ago

b2yq commented 3 years ago

I saw similar ticket that was closed without investigation here. My client is using

Rebus.Workers = 5

Behaviour looks like this. I am running some saga. During saga I can get a message that I want to enqueue after saga so I am using Rebus Defer to postpone for 5 minutes a message if saga is running. After 5 minutes when message arrive once more, i am checking once again if Saga is still running and if not then i am handling this message properly.

The problem is that, it is working ok for some time and after some time defered messages are starting duplicating. So we can see in logs messages with the same id, like this: 1->1->1->1->1->1->2->3->5->6->7 So if we have many messages for example 7000 than in few seconds queue can get up to 14000. And this is serious problem.

mookid8000 commented 3 years ago

Sounds pretty weird. Can you reproduce it somehow? Then I'll be happy to debug it.

b2yq commented 3 years ago

ok i will try to prepare some tests for that

mookid8000 commented 3 years ago

Hi @oocpawel , did you figure something out here?

b2yq commented 3 years ago

not yet, because of a black-week

b2yq commented 3 years ago

closed? are you joking? I saw the same ticket already closed without fix: https://github.com/rebus-org/Rebus/issues/847 and this one you are closing too? without checking it?

mookid8000 commented 3 years ago

Hi @oocpawel , sorry about that - I'd still be happy to investigate, if you can reproduce it somehow.

Or if you have any other hints towards what could be going on here, please let me know.