From d1225104a3a12f46143e2facc78b54fbe87c8056 Mon Sep 17 00:00:00 2001 From: Johnny Schmidt Date: Mon, 21 Oct 2024 09:25:12 -0700 Subject: [PATCH] Bulk Load CDK: Fix transient failure due to multiple channel closures (#47130) --- .../kotlin/io/airbyte/cdk/load/file/s3/S3MultipartUpload.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/airbyte-cdk/bulk/toolkits/load-s3/src/main/kotlin/io/airbyte/cdk/load/file/s3/S3MultipartUpload.kt b/airbyte-cdk/bulk/toolkits/load-s3/src/main/kotlin/io/airbyte/cdk/load/file/s3/S3MultipartUpload.kt index f65f88a70688..2e87550fb94b 100644 --- a/airbyte-cdk/bulk/toolkits/load-s3/src/main/kotlin/io/airbyte/cdk/load/file/s3/S3MultipartUpload.kt +++ b/airbyte-cdk/bulk/toolkits/load-s3/src/main/kotlin/io/airbyte/cdk/load/file/s3/S3MultipartUpload.kt @@ -81,10 +81,8 @@ class S3MultipartUpload( inner class UploadStream : OutputStream() { override fun close() = runBlocking { - workQueue.send { - if (closeOnce.setOnce()) { - workQueue.close() - } + if (closeOnce.setOnce()) { + workQueue.send { workQueue.close() } } }