Skip to content

Conversation

jgolda
Copy link
Contributor

@jgolda jgolda commented Aug 26, 2025

Since it looks like #1543 is not going anywhere soon, i suggest a simple refactor, which will allow a reasonable client-side fix for this issue.

The workaround suggested in #1543 (comment) is to override the methods, which use the java.util.concurrent.CompletableFuture#supplyAsync() in a custom subclass of the MinioAsyncClient. As of now it's not possible, since some methods which call the CompletableFuture#supplyAsync() also use package-private classes such as io.minio.PartReader (io.minio.S3Base#putObjectAsync()) or io.minio.HttpRequestBody (io.minio.MinioAsyncClient#putObjectFanOut).
Apart from this, java.util.concurrent.CompletableFuture#supplyAsync() is used by 7 methods, once of them private. In total they make ~800 lines of code. Frankly, it would be a real pain in the ass to maintain this amount of library code copy-pasted to the application for no good reason.

This PR extracts all of the java.util.concurrent.CompletableFuture#supplyAsync() calls into a separate protected method in io.minio.S3Base. With this change everyone interested in a different way of supplying their async :) will only need to override a single short method dedicated for that sole purpose.

Please review it and let me know if you're ok with this change or if any additional changes are required

@jgolda jgolda changed the title Extracted common overrideable method for creating a CompletableFuture Common overrideable method for creating a CompletableFuture Aug 26, 2025
@balamurugana
Copy link
Member

This PR is taken care in #1621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants