New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving messages with MSMQ to the error queue with TimeToBeReceived
causes the endpoint to shutdown
#3378
Conversation
@Particular/nservicebus-maintainers can someone quickly glance over it. I had to backport manually the tests and the implementation from 5.1.9 to 5.0.11. The nasty thing is I had to use dynamic for the builder fake :( |
sender.Send(message, new SendOptions(ErrorQueue)); | ||
return; | ||
} | ||
|
||
message.TimeToBeReceived = TimeSpan.MaxValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we move that to line 61 and delete the duplicate at 64?
850a735
to
4ea624d
Compare
@timbussmann fixed. The duplication was introduced by the way I tested and evolved the code. Good catch |
Reset TTBR before error queueMoving messages with MSMQ to the error queue with `TimeToBeReceived` causes the endpoint to shutdown
TimeToBeReceived
causes the endpoint to shutdownTimeToBeReceived
causes the endpoint to shutdown
@danielmarbach how about renaming the issue title to something readable like "Reset TimeToBeReceived before moving message to ErrorQueue"? |
TimeToBeReceived
causes the endpoint to shutdownTimeToBeReceived
causes the endpoint to shutdown
@timbussmann that slipped in. Changed |
Removed workaround section as it's not helping customers. Original section was:
|
Who's affected
TimeToBeReceived
setSymptoms
When a message arrives on an endpoint with a
TimeToBeReceived
set and that messages fails to be processed (i.e. because of SerializationException) the message cannot be moved to the error queue. The following exception is raised:Since this is a fatal error which triggers the CircuitBreaker the endpoint will shutdown after a while. Restarts won't help since the message will be tried to process again and the end resullt will be another endpoint shutdwon
Description
Originally raised here Particular/ServiceControl#624
When a message can't be properly deserialized we try to send it to the error queue. But if that message contains a
TimeToBeReceived
the following excpetion is raised internally:https://github.com/Particular/NServiceBus/blob/master/src/NServiceBus.Core/Transports/Msmq/MsmqMessageSender.cs#L41
This then ultimately leads to a ServiceControl shutdown at some point.
It seems that in V5 we don't remove the
TimeToBeReceived
when sending to the error queue.https://github.com/Particular/NServiceBus/blob/master/src/NServiceBus.Core/Faults/Forwarder/FaultManager.cs#L57
When fixing the bug we assumed passing in a new
SendOption
is enough. But the FaultManager uses theTimeToBeReceived
set on theTransportMessage
. So everytime we hit this the endpoint will trigger critical error and shutdown the endpoint but at least we don't loose a message/ cc @janovesk