8000 HADOOP-19205. S3A: initialization/close slower than with v1 SDK by steveloughran · Pull Request #6892 · apache/hadoop · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

HADOOP-19205. S3A: initialization/close slower than with v1 SDK #6892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

steveloughran
Copy link
Contributor
@steveloughran steveloughran commented Jun 17, 2024

HADOOP-19205

Adds new ClientManager interface/impl which provides on-demand creation of sync and async s3 clients, s3 transfer manager, and in close() terminates these.

S3A FS is modified to

  • Create one of these and hand off to S3Store
  • Use the same ClientManager interface against S3Store to demand-create the services.
  • only create the async client as part of the transfer manager creation, during rename.
  • stats on client creation count/duration are recorded.
  • statistics on the time to initialize and shutdown the s3afs is collected in IOStatistics for reporting.

The s3client is still created in FileSystem.initialize(), it is the async one which
is on demand.

No attempt to do async creation of the s3 client in initialize, though it could offer marginal benefits, depending on the codepath.

Change-Id: I79a668aacd920048447485afed77df573a38cb37

How was this patch tested?

Relying on regression tests knowing that this codepath will be tested.

Some other tests will be needed. e.g

  • verify recurrent creation always returns same instance.
  • behaviour after close()

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 9s Maven dependency ordering for branch
+1 💚 mvninstall 19m 50s trunk passed
+1 💚 compile 8m 41s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 53s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 5s trunk passed
+1 💚 mvnsite 1m 31s trunk passed
+1 💚 javadoc 1m 6s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 3s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 14s trunk passed
+1 💚 shadedclient 20m 15s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for patch
+1 💚 mvninstall 0m 49s the patch passed
+1 💚 compile 8m 25s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 25s the patch passed
+1 💚 compile 7m 57s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 57s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 0s /results-checkstyle-root.txt root: The patch generated 6 new + 17 unchanged - 3 fixed = 23 total (was 20)
+1 💚 mvnsite 1m 26s the patch passed
+1 💚 javadoc 1m 6s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
-1 ❌ javadoc 0m 33s /results-javadoc-javadoc-hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-1~20.04.1-b08.txt hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-120.04.1-b08 with JDK Private Build-1.8.0_412-8u412-ga-120.04.1-b08 generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
+1 💚 spotbugs 2m 23s the patch passed
+1 💚 shadedclient 21m 7s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 19s hadoop-common in the patch passed.
+1 💚 unit 2m 19s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 39s The patch does not generate ASF License warnings.
154m 4s
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/1/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 0f2edb9ab5e1 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 0cf5e6d
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/1/testReport/
Max. process+thread count 1283 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 20s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 7s Maven dependency ordering for branch
+1 💚 mvninstall 19m 47s trunk passed
+1 💚 compile 8m 40s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 57s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 4s trunk passed
+1 💚 mvnsite 1m 34s trunk passed
+1 💚 javadoc 1m 9s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 4s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 18s trunk passed
+1 💚 shadedclient 20m 8s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for patch
+1 💚 mvninstall 0m 48s the patch passed
+1 💚 compile 8m 16s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 16s the patch passed
+1 💚 compile 7m 49s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 49s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 58s /results-checkstyle-root.txt root: The patch generated 11 new + 17 unchanged - 3 fixed = 28 total (was 20)
+1 💚 mvnsite 1m 23s the patch passed
+1 💚 javadoc 1m 5s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
-1 ❌ javadoc 0m 34s /results-javadoc-javadoc-hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-1~20.04.1-b08.txt hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-120.04.1-b08 with JDK Private Build-1.8.0_412-8u412-ga-120.04.1-b08 generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
-1 ❌ spotbugs 0m 59s /new-spotbugs-hadoop-tools_hadoop-aws.html hadoop-tools/hadoop-aws generated 6 new + 0 unchanged - 0 fixed = 6 total (was 0)
+1 💚 shadedclient 20m 22s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 23m 37s hadoop-common in the patch passed.
+1 💚 unit 2m 25s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 42s The patch does not generate ASF License warnings.
153m 53s
Reason Tests
SpotBugs module:hadoop-tools/hadoop-aws
Possible doublecheck on org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3AsyncClient in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() At ClientManagerImpl.java:org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() At ClientManagerImpl.java:[lines 123-127]
Possible doublecheck on org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3Client in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateS3Client() At ClientManagerImpl.java:org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateS3Client() At ClientManagerImpl.java:[lines 104-108]
Possible doublecheck on org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.transferManager in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateTransferManager() At ClientManagerImpl.java:org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateTransferManager() At ClientManagerImpl.java:[lines 143-146]
Inconsistent synchronization of org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3AsyncClient; locked 40% of time Unsynchronized access at ClientManagerImpl.java:40% of time Unsynchronized access at ClientManagerImpl.java:[line 123]
Inconsistent synchronization of org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3Client; locked 40% of time Unsynchronized access at ClientManagerImpl.java:40% of time Unsynchronized access at ClientManagerImpl.java:[line 104]
Inconsistent synchronization of org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.transferManager; locked 40% of time Unsynchronized access at ClientManagerImpl.java:40% of time Unsynchronized access at ClientManagerImpl.java:[line 143]
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/2/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux ccc570bdf976 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 83ed705
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/2/testReport/
Max. process+thread count 1286 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor
@shameersss1 shameersss1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this idea of lazy initialization of async client and the new interface for creating s3 client.

@steveloughran - Do we see any visible performance impact for this ? Let's say for all read queries where async client/transfer manager is not used ?

Copy link
Contributor
@ahmarsuhail ahmarsuhail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, really like this. just a couple of small comments.

* @throws IOException failure.
*/
private void bindAWSClient(URI name, boolean dtEnabled) throws IOException {
private ClientManager bindAWSClient(URI fsURI, boolean dtEnabled) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we rename this method to createClientManager since it's not really binding AWS clients anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@steveloughran
Copy link
Contributor Author

Syed, not got numbers yet, though I will try to collect some before/after values

Adds new ClientManager interface/impl which provides on-demand
creation of sync and async s3 clients, s3 transfer manager,
and in close() terminates these.

S3A FS is modified to
* Create one of these and hand off to S3Store
* Use the same ClientManager interface against S3Store to demand-create
  the services.
* only create the async client as part of the transfer manager creation,
  during rename.
* stats on client creation count/duration are recorded.
+ statistics on the time to initialize and shutdown the s3afs is collected
  in IOStatistics for reporting.

No attempt to do async creation of the s3 client in initialize, though it could
offer marginal benefits, depending on the codepath.

Change-Id: I79a668aacd920048447485afed77df573a38cb37
* ClientManager getOrCreate* methods are unsynchronized so one thread
  won't block just because the another thread is busy creating a different
  client
* the actual creation operations are synchronized, with checks for closure
  inside them in case the manager is closed while they await the lock.
* close() is parallelized.
* some logging at debug; warn on exception during close()
* some init/accessor tuning to ensure mocking tests still work...
  (with an unrealistic goal of making it easier...)

Change-Id: I3e72172834232cc159d938c372d974d6672624f8
+ add a new FutureIO.toSupplier(CallableRaisingIOE<>) which takes
 a callable and returns a supplier, so its easier to schedule
 IOE-raising operations.

+ review comments

Change-Id: I0a17167e3b0fdde0ff379dd5c28c945782d5dbd2
+shut up spotbugs

Change-Id: Ie4cace3da846787018e6e2f7c14c6006b64dd667
* @return the S3 client.
* @throws IOException on any failure to create the client.
*/
private S3Client getS3Client() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this method required when we have getOrCreateS3Client() method already ?

@steveloughran steveloughran force-pushed the s3/HADOOP-19205-s3a-init-performance branch from deec1fc to 8af6f39 Compare June 19, 2024 17:58
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 11s Maven dependency ordering for branch
+1 💚 mvninstall 20m 33s trunk passed
+1 💚 compile 9m 13s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 8m 9s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 3s trunk passed
+1 💚 mvnsite 1m 22s trunk passed
+1 💚 javadoc 1m 1s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 0m 56s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 33s trunk passed
+1 💚 shadedclient 22m 52s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 20s Maven dependency ordering for patch
+1 💚 mvninstall 0m 53s the patch passed
+1 💚 compile 8m 34s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 34s the patch passed
+1 💚 compile 8m 7s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 8m 7s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 11s /results-checkstyle-root.txt root: The patch generated 11 new + 17 unchanged - 3 fixed = 28 total (was 20)
+1 💚 mvnsite 1m 22s the patch passed
+1 💚 javadoc 0m 58s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
-1 ❌ javadoc 0m 25s /results-javadoc-javadoc-hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-1~20.04.1-b08.txt hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-120.04.1-b08 with JDK Private Build-1.8.0_412-8u412-ga-120.04.1-b08 generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
-1 ❌ spotbugs 0m 54s /new-spotbugs-hadoop-tools_hadoop-aws.html hadoop-tools/hadoop-aws generated 6 new + 0 unchanged - 0 fixed = 6 total (was 0)
+1 💚 shadedclient 23m 5s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 15m 48s hadoop-common in the patch passed.
+1 💚 unit 2m 19s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
153m 11s
Reason Tests
SpotBugs module:hadoop-tools/hadoop-aws
Possible doublecheck on org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3AsyncClient in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() At ClientManagerImpl.java:org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() At ClientManagerImpl.java:[lines 121-125]
Possible doublecheck on org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3Client in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateS3Client() At ClientManagerImpl.java:org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateS3Client() At ClientManagerImpl.java:[lines 102-106]
Possible doublecheck on org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.transferManager in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateTransferManager() At ClientManagerImpl.java:org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateTransferManager() At ClientManagerImpl.java:[lines 141-144]
Inconsistent synchronization of org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3AsyncClient; locked 40% of time Unsynchronized access at ClientManagerImpl.java:40% of time Unsynchronized access at ClientManagerImpl.java:[line 121]
Inconsistent synchronization of org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.s3Client; locked 40% of time Unsynchronized access at ClientManagerImpl.java:40% of time Unsynchronized access at ClientManagerImpl.java:[line 102]
Inconsistent synchronization of org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.transferManager; locked 40% of time Unsynchronized access at ClientManagerImpl.java:40% of time Unsynchronized access at ClientManagerImpl.java:[line 141]
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/3/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux e04581c22455 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 4c9a619
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/3/testReport/
Max. process+thread count 3152 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 2s Maven dependency ordering for branch
+1 💚 mvninstall 22m 33s trunk passed
+1 💚 compile 9m 32s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 54s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 5s trunk passed
+1 💚 mvnsite 1m 24s trunk passed
+1 💚 javadoc 1m 4s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 0m 56s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 8s trunk passed
+1 💚 shadedclient 22m 47s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for patch
+1 💚 mvninstall 0m 49s the patch passed
+1 💚 compile 9m 17s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 9m 17s the patch passed
+1 💚 compile 7m 59s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 59s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 3s /results-checkstyle-root.txt root: The patch generated 11 new + 17 unchanged - 3 fixed = 28 total (was 20)
+1 💚 mvnsite 1m 19s the patch passed
+1 💚 javadoc 0m 56s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
-1 ❌ javadoc 0m 26s /results-javadoc-javadoc-hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-1~20.04.1-b08.txt hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-120.04.1-b08 with JDK Private Build-1.8.0_412-8u412-ga-120.04.1-b08 generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
-1 ❌ spotbugs 0m 54s /new-spotbugs-hadoop-tools_hadoop-aws.html hadoop-tools/hadoop-aws generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 shadedclient 23m 30s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 21s hadoop-common in the patch passed.
-1 ❌ unit 2m 25s /patch-unit-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
156m 18s
Reason Tests
SpotBugs module:hadoop-tools/hadoop-aws
Null pointer dereference of ClientManagerImpl.s3AsyncClient in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() Dereferenced at ClientManagerImpl.java:in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() Dereferenced at ClientManagerImpl.java:[line 117]
Failed junit tests hadoop.fs.s3a.impl.TestClientManager
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/4/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 53142d68ff60 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / deec1fc
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/4/testReport/
Max. process+thread count 3152 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/4/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 18m 29s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 11s Maven dependency ordering for branch
+1 💚 mvninstall 36m 55s trunk passed
+1 💚 compile 19m 29s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 17m 51s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 4m 48s trunk passed
+1 💚 mvnsite 2m 39s trunk passed
+1 💚 javadoc 1m 54s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 39s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 3m 52s trunk passed
+1 💚 shadedclient 39m 57s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 1m 27s the patch passed
+1 💚 compile 18m 49s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 18m 49s the patch passed
+1 💚 compile 18m 8s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 18m 8s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 44s /results-checkstyle-root.txt root: The patch generated 11 new + 17 unchanged - 3 fixed = 28 total (was 20)
+1 💚 mvnsite 2m 35s the patch passed
+1 💚 javadoc 1m 45s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
-1 ❌ javadoc 0m 48s /results-javadoc-javadoc-hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-1~20.04.1-b08.txt hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-120.04.1-b08 with JDK Private Build-1.8.0_412-8u412-ga-120.04.1-b08 generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
-1 ❌ spotbugs 1m 32s /new-spotbugs-hadoop-tools_hadoop-aws.html hadoop-tools/hadoop-aws generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 shadedclient 41m 23s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 19m 34s hadoop-common in the patch passed.
-1 ❌ unit 3m 8s /patch-unit-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch passed.
+1 💚 asflicense 1m 3s The patch does not generate ASF License warnings.
285m 1s
Reason Tests
SpotBugs module:hadoop-tools/hadoop-aws
Null pointer dereference of ClientManagerImpl.s3AsyncClient in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() Dereferenced at ClientManagerImpl.java:in org.apache.hadoop.fs.s3a.impl.ClientManagerImpl.getOrCreateAsyncClient() Dereferenced at ClientManagerImpl.java:[line 117]
Failed junit tests hadoop.fs.s3a.impl.TestClientManager
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/5/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 45580ab1dd7f 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 8af6f39
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/5/testReport/
Max. process+thread count 1236 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/5/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@steveloughran
Copy link
Contributor Author

update: going to pull out the reused code into some

AtomicAutoCloseable(function) which takes a supplier as an arg and invokes it if needed, call close if not. No plans to be clever about failure handling, just retry on each get().
close() will close the inner ref if set

add class LazyAtomicReference<T>

This take a constructor CallableRaisingIOE which is then
invoked on demand to create the reference value the first time
it is evaluated in get().

It has a getUnchecked() to wrap any IOEs raised,
and implements CallableRaisingIOE<T> so its get()
call can be chained/wrapped etc.

The subclass LazyAutoCloseableReference<T extends AutoCloseable>
takes AutoCloseables, implements the interface and in close() will close
the inner reference if it is set.

These are used in ClientManagerImpl instead of doing all the null checks &c
itself.

Tests for parallel creation are now more sophisticated
* semaphore + sleep choreography
* assertions on thread ID of thread creating the class
This should be a lot less brittle to timing issues

Change-Id: Idf9770c072b0436331a76f983e533528932dceff
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 21s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 13s Maven dependency ordering for branch
+1 💚 mvninstall 19m 57s trunk passed
+1 💚 compile 8m 44s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 59s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 5s trunk passed
+1 💚 mvnsite 1m 30s trunk passed
+1 💚 javadoc 1m 12s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 3s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 19s trunk passed
+1 💚 shadedclient 19m 59s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 22s Maven dependency ordering for patch
+1 💚 mvninstall 0m 48s the patch passed
+1 💚 compile 8m 13s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 13s the patch passed
+1 💚 compile 7m 54s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 54s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 4s /results-checkstyle-root.txt root: The patch generated 14 new + 5 unchanged - 15 fixed = 19 total (was 20)
+1 💚 mvnsite 1m 25s the patch passed
+1 💚 javadoc 1m 7s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
-1 ❌ javadoc 0m 31s /results-javadoc-javadoc-hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-1~20.04.1-b08.txt hadoop-tools_hadoop-aws-jdkPrivateBuild-1.8.0_412-8u412-ga-120.04.1-b08 with JDK Private Build-1.8.0_412-8u412-ga-120.04.1-b08 generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
+1 💚 spotbugs 2m 25s the patch passed
+1 💚 shadedclient 20m 19s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 12s hadoop-common in the patch passed.
+1 💚 unit 2m 26s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 39s The patch does not generate ASF License warnings.
147m 8s
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/6/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 0331ef8c6563 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6de4984
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/6/testReport/
Max. process+thread count 1273 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Consol 9E88 e output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/6/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Change-Id: I92ba2afb7bae0c3c9fc0c36ecbdec0790d1c009b
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 21s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 22s Maven dependency ordering for branch
+1 💚 mvninstall 19m 56s trunk passed
+1 💚 compile 8m 39s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 56s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 1s trunk passed
+1 💚 mvnsite 1m 33s trunk passed
+1 💚 javadoc 1m 5s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 4s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 12s trunk passed
+1 💚 shadedclient 20m 19s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 20s Maven dependency ordering for patch
+1 💚 mvninstall 0m 51s the patch passed
+1 💚 compile 8m 20s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 20s the patch passed
+1 💚 compile 7m 49s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 49s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 1m 59s /results-checkstyle-root.txt root: The patch generated 14 new + 5 unchanged - 15 fixed = 19 total (was 20)
+1 💚 mvnsite 1m 25s the patch passed
+1 💚 javadoc 1m 7s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 4s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 26s the patch passed
+1 💚 shadedclient 20m 36s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 21s hadoop-common in the patch passed.
+1 💚 unit 2m 23s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
147m 56s
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/7/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux b430aecb3ed2 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 84ec166
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/7/testReport/
Max. process+thread count 1316 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/7/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

Change-Id: Ia3a502f14c35022b66b0fae4a6e6326cbb145189
@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 19s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 19s Maven dependency ordering for branch
+1 💚 mvninstall 19m 46s trunk passed
+1 💚 compile 8m 37s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 8m 6s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 8s trunk passed
+1 💚 mvnsite 1m 28s trunk passed
+1 💚 javadoc 1m 11s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 4s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 14s trunk passed
+1 💚 shadedclient 20m 11s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 22s Maven dependency ordering for patch
+1 💚 mvninstall 0m 51s the patch passed
+1 💚 compile 8m 15s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 15s the patch passed
+1 💚 compile 7m 48s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 48s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 2m 3s root: The patch generated 0 new + 5 unchanged - 15 fixed = 5 total (was 20)
+1 💚 mvnsite 1m 27s the patch passed
+1 💚 javadoc 1m 5s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 9s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 24s the patch passed
+1 💚 shadedclient 20m 28s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 17s hadoop-common in the patch passed.
+1 💚 unit 2m 32s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 40s The patch does not generate ASF License warnings.
147m 32s
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/8/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 80cc3dd74428 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 6f28ee2
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/8/testReport/
Max. process+thread count 3153 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/8/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@steveloughran
Copy link
Contributor Author
steveloughran commented Jun 21, 2024

tested, s3 london. -Dparallel-tests -DtestsThreadCount=10 -Dscale.

One odd failure, where an s3 request was considered to be outside of a span even though the callchain implies it was within a span.

not going to show up in productin where unaudited requests are allowed, and not seen on standalone test runs. Note, normally I run with 8 threads..

[ERROR] Tests run: 26, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 67.44 s <<< FAILURE! - in org.apache.hadoop.fs.s3a.impl.ITestPartialRenamesDeletes
[ERROR] testPartialDirDelete[bulk-delete=false](org.apache.hadoop.fs.s3a.impl.ITestPartialRenamesDeletes)  Time elapsed: 1.42 s  <<< ERROR!
java.nio.file.AccessDeniedException: s3a://stevel-london/job-00-fork-00010/test/testPartialDirDelete[bulk-delete=false]-single-1718976320.541/readonlyDir/file-000: org.apache.hadoop.fs.s3a.audit.AuditFailureException: c1e28a95-20cb-4a6a-8c2c-115640a74e24-00000040 unaudited operation executing a request outside an audit span {object_list_request 'job-00-fork-00010/test/testPartialDirDelete[bulk-delete=false]-single-1718976320.541/readonlyDir/file-000/' size=2, mutating=false}
        at org.apache.hadoop.fs.s3a.audit.AuditIntegration.translateAuditException(AuditIntegration.java:161)
        at org.apache.hadoop.fs.s3a.audit.AuditIntegration.maybeTranslateAuditException(AuditIntegration.java:175)
        at org.apache.hadoop.fs.s3a.S3AUtils.translateException(S3AUtils.java:198)
        at org.apache.hadoop.fs.s3a.S3AUtils.translateException(S3AUtils.java:155)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.s3GetFileStatus(S3AFileSystem.java:4110)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.innerGetFileStatus(S3AFileSystem.java:3966)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.innerCreateFile(S3AFileSystem.java:2095)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.lambda$create$5(S3AFileSystem.java:2049)
        at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.invokeTrackingDuration(IOStatisticsBinding.java:547)
        at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.lambda$trackDurationOfOperation$5(IOStatisticsBinding.java:528)
        at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.trackDuration(IOStatisticsBinding.java:449)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.trackDurationAndSpan(S3AFileSystem.java:2796)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.trackDurationAndSpan(S3AFileSystem.java:2815)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.create(S3AFileSystem.java:2048)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1233)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1210)
        at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1091)
        at org.apache.hadoop.fs.contract.ContractTestUtils.createFile(ContractTestUtils.java:654)
        at org.apache.hadoop.fs.s3a.S3ATestUtils.lambda$put$1(S3ATestUtils.java:1009)
        at org.apache.hadoop.fs.s3a.impl.CallableSupplier.get(CallableSupplier.java:88)
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
        at org.apache.hadoop.util.SemaphoredDelegatingExecutor$RunnableWithPermitRelease.run(SemaphoredDelegatingExecutor.java:225)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.hadoop.fs.s3a.audit.AuditFailureException: c1e28a95-20cb-4a6a-8c2c-115640a74e24-00000040 unaudited operation executing a request outside an audit span {object_list_request 'job-00-fork-00010/test/testPartialDirDelete[bulk-delete=false]-single-1718976320.541/readonlyDir/file-000/' size=2, mutating=false}
        at org.apache.hadoop.fs.s3a.audit.impl.LoggingAuditor$WarningSpan.beforeExecution(LoggingAuditor.java:515)
        at org.apache.hadoop.fs.s3a.audit.impl.ActiveAuditManagerS3A$WrappingAuditSpan.beforeExecution(ActiveAuditManagerS3A.java:811)
        at org.apache.hadoop.fs.s3a.audit.impl.ActiveAuditManagerS3A.beforeExecution(ActiveAuditManagerS3A.java:492)
        at software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.lambda$beforeExecution$1(ExecutionInterceptorChain.java:59)
        at java.util.ArrayList.forEach(ArrayList.java:1259)
        at software.amazon.awssdk.core.interceptor.ExecutionInterceptorChain.beforeExecution(ExecutionInterceptorChain.java:59)
        at software.amazon.awssdk.awscore.internal.AwsExecutionContextBuilder.runInitialInterceptors(AwsExecutionContextBuilder.java:239)
        at software.amazon.awssdk.awscore.internal.AwsExecutionContextBuilder.invokeInterceptorsAndCreateExecutionContext(AwsExecutionContextBuilder.java:130)
        at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.invokeInterceptorsAndCreateExecutionContext(AwsSyncClientHandler.java:67)
        at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:76)
        at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
        at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
        at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
        at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
        at software.amazon.awssdk.services.s3.DefaultS3Client.listObjectsV2(DefaultS3Client.java:7327)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.lambda$listObjects$13(S3AFileSystem.java:3053)
        at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.invokeTrackingDuration(IOStatisticsBinding.java:547)
        at org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.lambda$trackDurationOfOperation$5(IOStatisticsBinding.java:528)
        at org.apache.hadoop.fs.s3a.Invoker.retryUntranslated(Invoker.java:468)
        at org.apache.hadoop.fs.s3a.Invoker.retryUntranslated(Invoker.java:431)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.listObjects(S3AFileSystem.java:3044)
        at org.apache.hadoop.fs.s3a.S3AFileSystem.s3GetFileStatus(S3AFileSystem.java:4082)
        ... 20 more


@steveloughran
Copy link
Contributor Author

somef more changes planned in the LazyAtomicReference class.

  • implement the Supplier interface, which invokes getUnchecked()
  • plus static fromSupplier() constructor

implementing supplier lets you something quite special with this: you can feed it in to any java api which takes a supplier, and, if the function supplied in the constructor is side-effect free & not dependent on external state, act as an on-demand cache of a function.

Surprised this isn't in the JDK already, either the team aren't aware of parallel graph reduction systems, or aware enough of the 1980s designs (e.g. ALICE) that they chose to avoid. Things are changing.

LazyAtomicReference implements Supplier as well as CallableRaisingIOE;
this lets you use this as an on-demand cache of the result of
an operation.

with test

Change-Id: Ia97acab62504b55892e91e8db70ae2bde570bbc0
@steveloughran
Copy link
Contributor Author
steveloughran commented Jun 24, 2024

tested with s3 london (versioned bucket), all good except for the usual ITestS3AConfiguration.testS3SpecificSignerOverride region failure

No performance timings except that we know that we delay creation of async and transfer manager.

  • If multiple treads use those classes (e.g on rename) they'll all block until the creation is completed, but I don't see it being any worse than today
  • Especially as slow FileSystem.get() can be problematic too

Applications which create many object store FS instances have a significant problem, independent of initialize() time: time to create a pool of https clients. Nothing we can do there except guide them into changes they need to make

@steveloughran steveloughran marked this pull request as ready for review June 24, 2024 13:52
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 6m 47s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 4 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 20s Maven dependency ordering for branch
+1 💚 mvninstall 19m 48s trunk passed
+1 💚 compile 8m 34s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 57s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 5s trunk passed
+1 💚 mvnsite 1m 33s trunk passed
+1 💚 javadoc 1m 6s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 5s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 18s trunk passed
+1 💚 shadedclient 20m 24s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 22s Maven dependency ordering for patch
+1 💚 mvninstall 0m 51s the patch passed
+1 💚 compile 8m 20s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 20s the patch passed
+1 💚 compile 8m 3s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 8m 3s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 2m 3s root: The patch generated 0 new + 5 unchanged - 15 fixed = 5 total (was 20)
+1 💚 mvnsite 1m 28s the patch passed
-1 ❌ javadoc 0m 41s /patch-javadoc-hadoop-common-project_hadoop-common-jdkUbuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2.txt hadoop-common in the patch failed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2.
+1 💚 javadoc 1m 8s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 30s the patch passed
+1 💚 shadedclient 20m 28s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 18s hadoop-common in the patch passed.
+1 💚 unit 2m 28s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 41s The patch does not generate ASF License warnings.
154m 32s
Subsystem Report/Notes
Docker ClientAPI=1.45 ServerAPI=1.45 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/9/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 271db9a518f5 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 5a5a335
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/9/testReport/
Max. process+thread count 3152 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/9/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

LazyAtomicReference: javadocs; eval() can be subclassed.
LazyAutoCloseableReference: closed flag ensures close is never called twice
 and that eval() fails when called on a closed ref.

changed LazyAtomicReference.fromSupplier() method name, added and equivalent
for its AutoCloseable subclass, with a different name.

Change-Id: I2936c500149be35c75ec2f617abdcd18d524f896
@steveloughran
Copy link
Contributor Author

retested s3 london -Dparallel-tests -DtestsThreadCount=10 -Dscale -Dprefetch, 15 minutes.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 20s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 5 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 18s Maven dependency ordering for branch
+1 💚 mvninstall 19m 30s trunk passed
+1 💚 compile 8m 36s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 compile 7m 52s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 checkstyle 2m 1s trunk passed
+1 💚 mvnsite 1m 28s trunk passed
+1 💚 javadoc 1m 7s trunk passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 7s trunk passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 15s trunk passed
+1 💚 shadedclient 20m 10s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 23s Maven dependency ordering for patch
+1 💚 mvninstall 0m 53s the patch passed
+1 💚 compile 8m 20s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javac 8m 20s the patch passed
+1 💚 compile 7m 56s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 javac 7m 56s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 1s /results-checkstyle-root.txt root: The patch generated 5 new + 5 unchanged - 15 fixed = 10 total (was 20)
+1 💚 mvnsite 1m 27s the patch passed
+1 💚 javadoc 1m 3s the patch passed with JDK Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2
+1 💚 javadoc 1m 6s the patch passed with JDK Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
+1 💚 spotbugs 2m 23s the patch passed
+1 💚 shadedclient 20m 36s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 16m 16s hadoop-common in the patch passed.
+1 💚 unit 2m 29s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 43s The patch does not generate ASF License warnings.
146m 51s
Subsystem Report/Notes
Docker ClientAPI=1.46 ServerAPI=1.46 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/10/artifact/out/Dockerfile
GITHUB PR #6892
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 9d0538763186 5.15.0-106-generic #116-Ubuntu SMP Wed Apr 17 09:17:56 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 8f51f92
Default Java Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.23+9-post-Ubuntu-1ubuntu120.04.2 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_412-8u412-ga-1~20.04.1-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/10/testReport/
Max. process+thread count 3153 (vs. ulimit of 5500)
modules C: hadoop-common-project/hadoop-common hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6892/10/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@shameersss1
Copy link
Contributor

@steveloughran - The changes LGTM +1. I do see some 2 seconds improvement while closing filesystem object when async client is not initialized/used.

Copy link
Contributor
@ahmarsuhail ahmarsuhail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM

@shameersss1
Copy link
Contributor

@steveloughran - Is there any more changes to be done ? I was thinking i could rebase HADOOP-18708 if this get merged.

@steveloughran steveloughran merged commit 4c55adb into apache:trunk Jul 5, 2024
4 checks passed
@steveloughran
Copy link
Contributor Author

will do, i've been off all week.

merged. will cherrypick.

note that apart from reported close() problems related to netty threads, it'd make sense to just have one client...this patch only reduces costs if rename() isn't used.

Before/while doing that, all interactions with the store should be pushed into the S3Store interface, so the rest of the code never gets direct access to S3Client

steveloughran added a commit that referenced this pull request Jul 5, 2024
Adds new ClientManager interface/implementation which provides on-demand
creation of synchronous and asynchronous s3 clients, s3 transfer manager,
and in close() terminates these.

S3A FS is modified to
* Create a ClientManagerImpl instance and pass down to its S3Store.
* Use the same ClientManager interface against S3Store to demand-create
  the services.
* Only create the async client as part of the transfer manager creation,
  which will take place during the first rename() operation.
* Statistics on client creation count and duration are recorded.
+ Statistics on the time to initialize and shutdown the S3A FS are collected
  in IOStatistics for reporting.

Adds to hadoop common class
  LazyAtomicReference<T> implements CallableRaisingIOE<T>, Supplier<T>
and subclass
  LazyAutoCloseableReference<T extends AutoCloseable>
    extends LazyAtomicReference<T> implements AutoCloseable

These evaluate the Supplier<T>/CallableRaisingIOE<T> they were
constructed with on the first (successful) read of the the value.
Any exception raised during this operation will be rethrown, and on future
evaluations the same operation retried.

These classes implement the Supplier and CallableRaisingIOE
interfaces so can actually be used for to implement lazy function evaluation
as Haskell and some other functional languages do.

LazyAutoCloseableReference is AutoCloseable; its close() method will
close the inner reference if it is set

This class is used in ClientManagerImpl for the lazy S3 Cliehnt creation
and closure.

Contributed by Steve Loughran.
KeeProMise pushed a commit to KeeProMise/hadoop that referenced this pull request Sep 9, 2024
…he#6892)


Adds new ClientManager interface/implementation which provides on-demand
creation of synchronous and asynchronous s3 clients, s3 transfer manager,
and in close() terminates these.

S3A FS is modified to
* Create a ClientManagerImpl instance and pass down to its S3Store.
* Use the same ClientManager interface against S3Store to demand-create
  the services.
* Only create the async client as part of the transfer manager creation,
  which will take place during the first rename() operation.
* Statistics on client creation count and duration are recorded.
+ Statistics on the time to initialize and shutdown the S3A FS are collected
  in IOStatistics for reporting.

Adds to hadoop common class
  LazyAtomicReference<T> implements CallableRaisingIOE<T>, Supplier<T>
and subclass
  LazyAutoCloseableReference<T extends AutoCloseable>
    extends LazyAtomicReference<T> implements AutoCloseable

These evaluate the Supplier<T>/CallableRaisingIOE<T> they were
constructed with on the first (successful) read of the the value.
Any exception raised during this operation will be rethrown, and on future
evaluations the same operation retried.

These classes implement the Supplier and CallableRaisingIOE
interfaces so can actually be used for to implement lazy function evaluation
as Haskell and some other functional languages do.

LazyAutoCloseableReference is AutoCloseable; its close() method will
close the inner reference if it is set

This class is used in ClientManagerImpl for the lazy S3 Cliehnt creation
and closure.

Contributed by Steve Loughran.
Hexiaoqiao pushed a commit to Hexiaoqiao/hadoop that referenced this pull request Sep 12, 2024
…he#6892)


Adds new ClientManager interface/implementation which provides on-demand
creation of synchronous and asynchronous s3 clients, s3 transfer manager,
and in close() terminates these.

S3A FS is modified to
* Create a ClientManagerImpl instance and pass down to its S3Store.
* Use the same ClientManager interface against S3Store to demand-create
  the services.
* Only create the async client as part of the transfer manager creation,
  which will take place during the first rename() operation.
* Statistics on client creation count and duration are recorded.
+ Statistics on the time to initialize and shutdown the S3A FS are collected
  in IOStatistics for reporting.

Adds to hadoop common class
  LazyAtomicReference<T> implements CallableRaisingIOE<T>, Supplier<T>
and subclass
  LazyAutoCloseableReference<T extends AutoCloseable>
    extends LazyAtomicReference<T> implements AutoCloseable

These evaluate the Supplier<T>/CallableRaisingIOE<T> they were
constructed with on the first (successful) read of the the value.
Any exception raised during this operation will be rethrown, and on future
evaluations the same operation retried.

These classes implement the Supplier and CallableRaisingIOE
interfaces so can actually be used for to implement lazy function evaluation
as Haskell and some other functional languages do.

LazyAutoCloseableReference is AutoCloseable; its close() method will
close the inner reference if it is set

This class is used in ClientManagerImpl for the lazy S3 Cliehnt creation
and closure.

Contributed by Steve Loughran.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0