From 09e6b1f4b97531d02b4a06dc64b3eccff115dc7d Mon Sep 17 00:00:00 2001 From: Johnny Schmidt Date: Sun, 20 Oct 2024 14:12:47 -0700 Subject: [PATCH] Bulk Load CDK: Fix transient failure due to multiple channel closures --- .../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() } } }