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

callHeartBeatWithQueryTimeout with default queryTimeout means 0 wait for future #1476

Closed
KarlHakanNordgren opened this issue Jul 18, 2023 · 3 comments
Assignees

Comments

@KarlHakanNordgren
Copy link

Hi hi

I'm puzzled by the following: The default value for queryTimeout is 0 which means that "that the driver should wait indefinitely" (see here). Looking at the callHeartBeatWithQueryTimeout I see that it tries to resolve a future with future.get(timeout, TimeUnit.SECONDS). According to the documentation for Future a 0 timeout here means a wait of "at most the given time" which is 0. (See here.)

What have I misunderstood?

@sfc-gh-spanaite sfc-gh-spanaite self-assigned this Oct 3, 2023
@sfc-gh-spanaite
Copy link
Contributor

@KarlHakanNordgren I think you probably missed where callHeartBeatWithQueryTimeout is called from:

public void callHeartBeat(int timeout) throws Exception, SFException {
    if (timeout > 0) {
      callHeartBeatWithQueryTimeout(timeout);
    } else {
      heartbeat();
    }
  }

This means we will call it only if queryTimeout > 0 otherwise we will call heartbeat() function which has a different logic.

@sfc-gh-spanaite
Copy link
Contributor

@KarlHakanNordgren Any other questions or we're good with closing this issue?

@sfc-gh-spanaite
Copy link
Contributor

Closing as this is not a bug. Feel free to open a new one if you still have questions.

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

No branches or pull requests

2 participants