Skip to content

Learning transport throws exceptions when running multiple endpoint instances#7324

Merged
SzymonPobiega merged 3 commits intomasterfrom
fix-learning-competing-consumers-bug
Apr 8, 2025
Merged

Learning transport throws exceptions when running multiple endpoint instances#7324
SzymonPobiega merged 3 commits intomasterfrom
fix-learning-competing-consumers-bug

Conversation

@SzymonPobiega
Copy link
Member

@SzymonPobiega SzymonPobiega commented Apr 8, 2025

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

  • Moving the file to the .pending transaction folder only returns true 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

return true;
}

Directory.Delete(transactionDir, true);
Copy link
Contributor

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?

Copy link
Member Author

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 <daniel.marbach@openplace.net>
@SzymonPobiega SzymonPobiega merged commit e4bd22d into master Apr 8, 2025
4 checks passed
@SzymonPobiega SzymonPobiega deleted the fix-learning-competing-consumers-bug branch April 8, 2025 10:15
@SzymonPobiega SzymonPobiega added this to the vNext milestone Apr 8, 2025
SzymonPobiega added a commit that referenced this pull request Apr 8, 2025
* 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 <daniel.marbach@openplace.net>
@andreasohlund andreasohlund modified the milestones: vNext, 9.2.7 Apr 9, 2025
@andreasohlund andreasohlund changed the title Fix learning competing consumers bug Learning transport throw exceptions when running multiple endpoint instances Apr 9, 2025
danielmarbach added a commit that referenced this pull request Apr 9, 2025
* 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 <daniel.marbach@openplace.net>
@SzymonPobiega SzymonPobiega changed the title Learning transport throw exceptions when running multiple endpoint instances Learning transport throws exceptions when running multiple endpoint instances Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants