From 79f94598733cf426e026757572b393fd40f163be Mon Sep 17 00:00:00 2001 From: mustafaelghrib Date: Fri, 18 Aug 2023 01:50:00 +0300 Subject: [PATCH] Improve documentation for multiprocessing/threading --- docs/source/guide/clients.rst | 4 ++++ docs/source/guide/session.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/source/guide/clients.rst b/docs/source/guide/clients.rst index 9a4c442391..aebbec5fdb 100644 --- a/docs/source/guide/clients.rst +++ b/docs/source/guide/clients.rst @@ -156,3 +156,7 @@ General Example futures = [executor.submit(do_s3_task, s3_client, task) for task in my_tasks] .. _Botocore Events: https://botocore.amazonaws.com/v1/documentation/api/latest/topics/events.html + +.. note:: + + Note that `boto3.client` uses a single, shared session for all calls. This can lead to concurrency issues unexpectedly when done across parallelization primitives. We recommend managing your own session(s) with concurrent code. diff --git a/docs/source/guide/session.rst b/docs/source/guide/session.rst index f89a8b7ed4..d00bb8decf 100644 --- a/docs/source/guide/session.rst +++ b/docs/source/guide/session.rst @@ -79,3 +79,7 @@ to create a new ``Session`` object for each thread or process:: s3 = session.resource('s3') # Put your thread-safe code here + +.. note:: + + Note that `boto3.client` uses a single, shared session for all calls. This can lead to concurrency issues unexpectedly when done across parallelization primitives. We recommend managing your own session(s) with concurrent code.