-
-
Notifications
You must be signed in to change notification settings - Fork 371
DefaultRetryStep failure handling moved to before processing message … #1213
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
base: master
Are you sure you want to change the base?
Conversation
…to avoid nested scope abortion for usage with transactionscope + transports enlisting in ambient transaction
I see tests regarding 2nd level is failing, Ill take a look at that |
@mookid8000 any possibilities for something like this? |
A last ping can never hurt.. @mookid8000 , is this considered dead or how should we treat it? |
hi @hjalle , sorry for the long silence here 😅 I have been pondering over this particular thing in the back of my mind since you first wrote, and I still really haven't reached a conclusion. Maybe we can talk about it here and somehow approach something together? The thing is this: All versions of Rebus < 8 had the error tracker check BEFORE dispatching the message, which was originally so because of MSMQ message queue transactions. From Rebus 8, all transports have worked the same way:
BUT as you have discovered, transaction scopes and the SQL transport cause this model to fail, because it effectively emulates the old behavior of MSMQ where all the queue interactions are enlisted in the same transaction. Honestly, I am more inclined to remove the transaction scope support, because it messes with the try-to-handle-message-ACK-or-NACK-model. What are your thoughts? |
Yes, I do see the point, but its kind of frustrating right now. We, and others I presume, have not yet fully migrated away from "DTC"-thinking. Our current workaround is essentially that we decorate the SQL-transport and have a in-memory delivery count, which will then "fail early" in the DefaultRetryStep, as that logic resides at the top.. I'm not sure if that has any drawbacks but at least it solves the issue with endless retry-loops. I don't really see it as a viable solution right now since it relies on the internals of the DefaultRetryStep that one as well, although it of course makes a lot more sense to have that logic at the beginning of the retry rather than at the end of the "last" delivery. Its also not a generic solution as v8 with enlistInAmbient, sql and transactionscopes will result in endless retries for all existing users. If the SQL-transport would add delivery counting, it would probably solve this issue, I guess..? |
First off, we are still on Rebus 6 because we have our own outbox/transaction scope handling and didn't want entanglement, so therefore this comment will be most likely completely offbase... We have had in the past the need to separate out (isolate) transaction scopes (for various reasons). We do that using:
Just throwing this out there... |
In reference to #1212, this is what I believe might be a solution, to avoid destroying the transactionscope that may be enlisted to.
Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.