Skip to content
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

Fix concurrency bottleneck, improve shutdown draining #278

Closed
wants to merge 1 commit into from

Conversation

rsafonseca
Copy link
Collaborator

@rsafonseca rsafonseca commented Jul 12, 2022

Fixes a bottleneck to concurrent processing caused by the handleMessages() function by offloading most of the processing handled by this function to the processMessage() workers, and avoiding an additional data copy to another channel.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2658393544

  • 29 of 49 (59.18%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 57.16%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cluster/nats_rpc_server.go 29 49 59.18%
Totals Coverage Status
Change from base Build 1263531920: -0.09%
Covered Lines: 3844
Relevant Lines: 6725

💛 - Coveralls

Copy link
Contributor

@felipejfc felipejfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Rafa! Can we remove from the init method the goroutine with shutdown logic? Also, can you share some benchmarks comparing the old code with this new one?

go ns.handleMessages()

go func() {
<-ns.stopChan
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move all this logic to a method of it's own? Or inside stop/shutdown methods of this class.

@felipejfc felipejfc closed this Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants