-
Notifications
You must be signed in to change notification settings - Fork 649
Learning transport throws exceptions when running multiple endpoint instances #7324
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
Conversation
src/NServiceBus.Core/Transports/Learning/DirectoryBasedTransaction.cs
Outdated
Show resolved
Hide resolved
return true; | ||
} | ||
|
||
Directory.Delete(transactionDir, true); |
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.
The rollback already does a delete. Is the rollback not consistently called and we have to do extra cleanup here?
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.
The Rollback
method is only called when BeginTransaction
returns true
…tion.cs Co-authored-by: Daniel Marbach <[email protected]>
* AsyncFile.Move returns true only if the file was read (i.e. exists and not locked) * Clean up the .pending directory if unable to move and unlock the file Co-authored-by: Daniel Marbach <[email protected]>
* AsyncFile.Move returns true only if the file was read (i.e. exists and not locked) * Clean up the .pending directory if unable to move and unlock the file Co-authored-by: Daniel Marbach <[email protected]>
Symptoms
When scaled out, endpoints using learning transport throw exceptions when another instance consumes a message
Who's affected
Only Monitoring Demo's Sales endpoint is affected
Details of the fix
.pending
transaction folder only returnstrue
if file exists and is not locked (and not just when all attempts have been used)BeginTransaction
removes the.pending
folder if fails to begin the transaction