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 potential deadlock in registry changes communication #45

Open
stanislav-zeman opened this issue Aug 28, 2024 · 0 comments
Open

Fix potential deadlock in registry changes communication #45

stanislav-zeman opened this issue Aug 28, 2024 · 0 comments

Comments

@stanislav-zeman
Copy link
Member

The change propagation (i.e. the channel communication) has to be somehow reworked. I currently "resolved" the issue in Consul registry by using buffered channel. Please note that if any service has the "delta" of instances (number of changes processed by writeChanges() method) greater than the channel buffer size it will deadlock. This is caused by the resolver which calls the Instances() method for each change which tries to read-lock the registry mutex. This is problematic in conjunction with the locking in the writeChanges() method which writes to this channel under write lock.

One potential fix could be communicating the changes in batches instead of sending message per service Registered/Unregistered state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant