From ce8e2f7f28578b32ae87219788ea5317ea2d72e2 Mon Sep 17 00:00:00 2001 From: Pavel Kovalenko Date: Thu, 17 Jun 2021 22:31:50 +0300 Subject: [PATCH] Avoid double initializing ReadBufferFromS3 --- src/IO/ReadBufferFromS3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IO/ReadBufferFromS3.cpp b/src/IO/ReadBufferFromS3.cpp index c04a937cc6a..9abdab11259 100644 --- a/src/IO/ReadBufferFromS3.cpp +++ b/src/IO/ReadBufferFromS3.cpp @@ -47,7 +47,8 @@ bool ReadBufferFromS3::nextImpl() bool next_result = false; auto sleep_time_with_backoff_milliseconds = std::chrono::milliseconds(100); - impl = initialize(); + if (!impl) + impl = initialize(); for (size_t attempt = 0; attempt < max_single_read_retries; ++attempt) {