Skip to content

Commit 9066af3

Browse files
committed
comments
1 parent ef5631b commit 9066af3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3ClientsManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ final AmazonS3Reference client(RepositoryMetadata repositoryMetadata) {
312312
return existing;
313313
}
314314
if (closed.get()) {
315-
// Not adding a new client once the manager is closed since there won't be anything to close it
315+
// Not adding a new client once the clients holder is closed since there won't be anything to close it
316316
throw new IllegalStateException("Project [" + projectId() + "] clients holder is closed");
317317
}
318318
if (managerClosed.get()) {
@@ -321,15 +321,15 @@ final AmazonS3Reference client(RepositoryMetadata repositoryMetadata) {
321321
throw new IllegalStateException("s3 clients manager is closed");
322322
}
323323
// The close() method maybe called after we checked it, it is ok since we are already inside the synchronized block.
324-
// The clearCache() will clear the newly added client.
324+
// The close method calls clearCache() which will clear the newly added client.
325325
final var newClientReference = clientBuilder.apply(settings);
326326
clientsCache = Maps.copyMapWithAddedEntry(clientsCache, clientKey, newClientReference);
327327
return newClientReference;
328328
}
329329
}
330330

331331
/**
332-
* Clear the cache by closing and clear out all clients. Subsequent {@link #client(RepositoryMetadata)} calls will recreate
332+
* Clear the cache by closing and clearing out all clients. Subsequent {@link #client(RepositoryMetadata)} calls will recreate
333333
* the clients and populate the cache again.
334334
*/
335335
final synchronized void clearCache() {

0 commit comments

Comments
 (0)