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

hotfix(exec) 0.9.25.7: remove possible RemoteExec deadlock cause #1776

Closed
wants to merge 9 commits into from

Conversation

alextheimer
Copy link
Contributor

@alextheimer alextheimer commented May 16, 2024

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?
  • Tests for the changes have been added (for bug fixes / features) ?
  • Docs have been added / updated (for bug fixes / features) ?

@alextheimer alextheimer changed the title *WIP* fix(exec): remove possible RemoteExec deadlock cause hotfix(exec) 0.9.25.6: remove possible RemoteExec deadlock cause May 16, 2024
@alextheimer alextheimer changed the title hotfix(exec) 0.9.25.6: remove possible RemoteExec deadlock cause hotfix(exec) 0.9.25.7: remove possible RemoteExec deadlock cause May 16, 2024
val waitUntilMs = System.currentTimeMillis() + unit.toMillis(timeout)
// looping in case thread is woken up early
while (!_shutdown && System.currentTimeMillis() < waitUntilMs) {
val waitMs = waitUntilMs - System.currentTimeMillis()
Copy link
Contributor

Choose a reason for hiding this comment

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

This can possibly become negative between your checks and calculation and will end up with IllegalArgumentException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch -- I assumed wrongly that negative values were ignored. Updated ✅

@@ -52,7 +52,7 @@ trait RemoteExec extends LeafExecPlan with StrictLogging {
val waitUntilMs = System.currentTimeMillis() + unit.toMillis(timeout)
// looping in case thread is woken up early
while (!_shutdown && System.currentTimeMillis() < waitUntilMs) {
val waitMs = waitUntilMs - System.currentTimeMillis()
val waitMs = Math.max(0, waitUntilMs - System.currentTimeMillis())
Copy link
Contributor

Choose a reason for hiding this comment

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

If its 0, you want till you are notified, is that the expected behavior?

Just to clarify, if the value is positive, it will come out of waiting state, go check the while condition and go back to waiting state, but with 0 it will never come out of wait until notified.

@alextheimer
Copy link
Contributor Author

Closed -- we can revisit this solution later if needed.

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