Skip to content

Commit c00e4c8

Browse files
authored
Update documentation for FUTURE_COMPLETION_EXECUTOR (#4950)
1 parent 85bf7bf commit c00e4c8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/sdk-core/src/main/java/software/amazon/awssdk/core/client/config/SdkAdvancedAsyncClientOption.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ public final class SdkAdvancedAsyncClientOption<T> extends ClientOption<T> {
4545
* <li>You want more fine-grained control over the {@link ThreadPoolExecutor} used, such as configuring the pool size
4646
* or sharing a single pool between multiple clients.
4747
* <li>You want to add instrumentation (i.e., metrics) around how the {@link Executor} is used.
48-
* <li>You know, for certain, that all of your {@link CompletableFuture} usage is strictly non-blocking, and you wish to
49-
* remove the minor overhead incurred by using a separate thread. In this case, you can use
50-
* {@code Runnable::run} to execute the future-completion directly from within the I/O thread.
5148
* </ol>
49+
* <b>WARNING</b>
50+
* <p>
51+
* We strongly <strong>discourage</strong> using {@code Runnable::run}, which executes the future-completion directly from
52+
* within the I/O thread because it may block the I/O thread and cause deadlock, especially if you are sending
53+
* another SDK request in the {@link CompletableFuture} chain since the SDK may perform blocking calls in some cases.
5254
*/
5355
public static final SdkAdvancedAsyncClientOption<Executor> FUTURE_COMPLETION_EXECUTOR =
5456
new SdkAdvancedAsyncClientOption<>(Executor.class);

0 commit comments

Comments
 (0)