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: Due to backend issues resolved, we no longer need to wait for 5 … #610

Merged
merged 1 commit into from Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -126,8 +126,6 @@ public class StreamWriter implements AutoCloseable {
// Used for schema updates
private OnSchemaUpdateRunnable onSchemaUpdateRunnable;

private final int REFRESH_STREAM_WAIT_TIME = 7;

/** The maximum size of one request. Defined by the API. */
public static long getApiMaxRequestBytes() {
return 10L * 1000L * 1000L; // 10 megabytes (https://en.wikipedia.org/wiki/Megabyte)
Expand Down Expand Up @@ -356,12 +354,7 @@ public void refreshAppend() throws IOException, InterruptedException {
}
} catch (InterruptedException expected) {
}
// Currently there is a bug that it took reconnected stream 5 seconds to pick up
// stream count. So wait at least 7 seconds before sending a new request.
Thread.sleep(
Math.max(
this.retrySettings.getInitialRetryDelay().toMillis(),
Duration.ofSeconds(REFRESH_STREAM_WAIT_TIME).toMillis()));
Thread.sleep(this.retrySettings.getInitialRetryDelay().toMillis());
// Can only unlock here since need to sleep the full 7 seconds before stream can allow appends.
appendAndRefreshAppendLock.unlock();
LOG.info("Write Stream " + streamName + " connection established");
Expand Down