You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "benibus (via GitHub)" <gi...@apache.org> on 2023/02/18 22:18:02 UTC

[GitHub] [arrow] benibus commented on a diff in pull request #34134: GH-34118: [C++][Python] Make # of S3 event loop threads configurable

benibus commented on code in PR #34134:
URL: https://github.com/apache/arrow/pull/34134#discussion_r1111116784


##########
cpp/src/arrow/filesystem/s3fs.cc:
##########
@@ -2591,6 +2596,20 @@ Status DoInitializeS3(const S3GlobalOptions& options) {
 
 #undef LOG_LEVEL_CASE
 
+#ifdef ARROW_S3_HAS_CRT
+  aws_options.ioOptions.clientBootstrap_create_fn =
+      [ev_threads = options.num_event_loop_threads]() {
+        // https://github.com/aws/aws-sdk-cpp/blob/1.11.15/src/aws-cpp-sdk-core/source/Aws.cpp#L65
+        Aws::Crt::Io::EventLoopGroup eventLoopGroup(ev_threads);
+        Aws::Crt::Io::DefaultHostResolver defaultHostResolver(
+            eventLoopGroup, /*maxHosts=*/8, /*maxTTL=*/30);
+        auto clientBootstrap = Aws::MakeShared<Aws::Crt::Io::ClientBootstrap>(
+            "Aws_Init_Cleanup", eventLoopGroup, defaultHostResolver);
+        clientBootstrap->EnableBlockingShutdown();
+        return clientBootstrap;

Review Comment:
   I suspect carrying over the camel-case was unintentional.
   ```suggestion
           Aws::Crt::Io::EventLoopGroup event_loop_group(ev_threads);
           Aws::Crt::Io::DefaultHostResolver default_host_resolver(
               event_loop_group, /*maxHosts=*/8, /*maxTTL=*/30);
           auto client_bootstrap = Aws::MakeShared<Aws::Crt::Io::ClientBootstrap>(
               "Aws_Init_Cleanup", event_loop_group, default_host_resolver);
           client_bootstrap->EnableBlockingShutdown();
           return client_bootstrap;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org