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

NodeDriver threads' contention over member node_ causes starvation #23

Open
moralismercatus opened this issue Apr 10, 2017 · 1 comment

Comments

@moralismercatus
Copy link
Collaborator

moralismercatus commented Apr 10, 2017

The dispatch-communication thread and the run-node thread compete for node_, as a shared resource. Either one of these can starve the other, if one repeatedly acquires node_ consecutively.

This is especially apparent when e.g., vm-node instances > 1. Because the run-node thread processes all VM instances before relinquishing node_, the issue is exacerbated given run-node's tendency to win the race for node_.

I implemented a fix on my fork: moralismercatus@e2774ac#diff-b5094f7d4fdca6fbd261c78e8b3d8c50

The idea is that when a transmission from dispatch is received, a flag is set. The run-node thread always checks if there's a pending transmission before acquiring node_. If true, then run-node thread waits until the transmission is complete before acquiring node_.

I don't consider it a perfect solution because a transmission could theoretically take considerable time to complete, and run-node is waiting idle during that period, but it works for my purposes, and is certainly an improvement over the current.

@likebreath
Copy link
Collaborator

It looks good to me. As this merge will be simple, I decide to merge it later (after recent changes from my branch are merged).

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

No branches or pull requests

2 participants