From a876b7d245a4af90c7e2854eb0b74b1d54e205db Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:50:10 -0800 Subject: [PATCH 1/3] Update documentation for FUTURE_COMPLETION_EXECUTOR --- .../core/client/config/SdkAdvancedAsyncClientOption.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java index ab9d87026abc..64d49f81e908 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java @@ -45,10 +45,12 @@ public final class SdkAdvancedAsyncClientOption extends ClientOption { *
  • You want more fine-grained control over the {@link ThreadPoolExecutor} used, such as configuring the pool size * or sharing a single pool between multiple clients. *
  • You want to add instrumentation (i.e., metrics) around how the {@link Executor} is used. - *
  • You know, for certain, that all of your {@link CompletableFuture} usage is strictly non-blocking, and you wish to - * remove the minor overhead incurred by using a separate thread. In this case, you can use - * {@code Runnable::run} to execute the future-completion directly from within the I/O thread. * + * Note + *

    + * We strongly recommend against using {@code Runnable::run}, which executes the future-completion directly from + * within the I/O thread because it may block the IO thread and cause deadlock, especially if you are sending + * another SDK request in the {@link CompletableFuture} chain since the SDK may perform blocking calls in some cases. */ public static final SdkAdvancedAsyncClientOption FUTURE_COMPLETION_EXECUTOR = new SdkAdvancedAsyncClientOption<>(Executor.class); From 8667546ea920d6676f3b4a940250e9427aaef080 Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:59:47 -0800 Subject: [PATCH 2/3] Address feedback --- .../awssdk/core/client/config/SdkAdvancedAsyncClientOption.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java index 64d49f81e908..ad47d0e98446 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java @@ -46,7 +46,7 @@ public final class SdkAdvancedAsyncClientOption extends ClientOption { * or sharing a single pool between multiple clients. *

  • You want to add instrumentation (i.e., metrics) around how the {@link Executor} is used. * - * Note + * WARNING *

    * We strongly recommend against using {@code Runnable::run}, which executes the future-completion directly from * within the I/O thread because it may block the IO thread and cause deadlock, especially if you are sending From d67bb9b3adf39fd191e3c242c2c5e5a3c697d9f7 Mon Sep 17 00:00:00 2001 From: Zoe Wang <33073555+zoewangg@users.noreply.github.com> Date: Tue, 20 Feb 2024 15:05:16 -0800 Subject: [PATCH 3/3] Address feedback --- .../core/client/config/SdkAdvancedAsyncClientOption.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java index ad47d0e98446..fb2a1135eeba 100644 --- a/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java +++ b/core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java @@ -48,8 +48,8 @@ public final class SdkAdvancedAsyncClientOption extends ClientOption { * * WARNING *

    - * We strongly recommend against using {@code Runnable::run}, which executes the future-completion directly from - * within the I/O thread because it may block the IO thread and cause deadlock, especially if you are sending + * We strongly discourage using {@code Runnable::run}, which executes the future-completion directly from + * within the I/O thread because it may block the I/O thread and cause deadlock, especially if you are sending * another SDK request in the {@link CompletableFuture} chain since the SDK may perform blocking calls in some cases. */ public static final SdkAdvancedAsyncClientOption FUTURE_COMPLETION_EXECUTOR =