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

IGNITE-10760 Fix confusing message about system worker blocking #7047

Closed
wants to merge 2 commits into from

Conversation

alievmirza
Copy link
Contributor

No description provided.

"This can lead to cluster-wide undefined behaviour " +
"[threadName=" + worker.name() + ", blockedFor=" + heartbeatDelay / 1000 + "s]");
"This can lead to cluster-wide undefined behaviour " +
"[workerName=" + worker.name() + ", threadName=" + worker.runner().getName() +
Copy link
Contributor

Choose a reason for hiding this comment

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

worker.runner() can return null in some cases, so it makes sense to add additional null checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can see from the code, the check has already been done at

if (runner != null && runner != Thread.currentThread() && !worker.isCancelled()) {

So it seems to me that we don't need to do additional check.

I can change worker.runner() to runner to make code cleaner, if it needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's classic check-then-act error. In your case NullPointerException is still possible. But using runner instead of worker.runner() solves the problem.

@alievmirza alievmirza closed this Nov 27, 2019
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

2 participants