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: re-use existing connection info during force refresh #1441

Merged
merged 7 commits into from
Sep 8, 2023

Conversation

enocom
Copy link
Member

@enocom enocom commented Aug 24, 2023

When the connector initiates a force refresh, it would previously discard existing connection info and block on the refresh operation completing. In case the cause of the connection failure is transient, we keep the current connection info around and refresh in the background. When the current connection info is in fact invalid, this will cause callers to see additional failures until the refresh completes (usually < 1s).

Fixes #1450.

@enocom enocom requested a review from a team as a code owner August 24, 2023 15:47
instance.getSslData();
assertThat(refreshCount.get()).isEqualTo(2);
// refresh count hasn't changed because we re-use the existing connection info
assertThat(refreshCount.get()).isEqualTo(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to add on to this test that forceRefresh() still works. That eventually assertThat(refreshCount.get()).isEqualTo(2); is true.

When the connector initiates a force refresh, it would previously
discard existing connection info and block on the refresh operation
completing. In case the cause of the connection failure is transient, we
keep the current connection info around and refresh in the background.
When the current connection info is in fact invalid, this will cause
callers to see additional failures until the refresh completes (usually
< 1s).
@@ -52,91 +51,7 @@ public void initialize(HttpRequest var1) throws IOException {
}
}

@Test(timeout = 20000)
public void testThatForceRefreshBalksWhenARefreshIsInProgress() throws Exception {
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this test was built around the old refresh behavior -- where current would block on the next refresh. I need to double check that we have good coverage for balking before I ask for another review.

Thread.sleep(100);
}

fail(String.format("refresh count should be 2, got = %d", refreshCount.get()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This works now.

@enocom enocom merged commit 769de5e into main Sep 8, 2023
16 checks passed
@enocom enocom deleted the better-refresh branch September 8, 2023 21:49
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.

Re-use connection info during ZDT
2 participants