@@ -45,14 +45,14 @@ public class S3PerProjectClientManager implements ClusterStateListener {
4545 private final Settings nodeS3Settings ;
4646 private final Function <S3ClientSettings , AmazonS3Reference > clientBuilder ;
4747 private final Executor executor ;
48- // A map of projectId to clients holder. Adding to and removing from the map happen only in the cluster state listener thread.
48+ // A map of projectId to clients holder. Adding to and removing from the map happen only in the applier thread.
4949 private final Map <ProjectId , ClientsHolder > projectClientsHolders ;
50- // Listener for tracking ongoing async closing of obsolete clients. Updated only in the cluster state listener thread.
50+ // Listener for tracking ongoing async closing of obsolete clients. Updated only in the applier thread.
5151 private volatile SubscribableListener <Void > clientsCloseListener = null ;
5252
5353 S3PerProjectClientManager (Settings settings , Function <S3ClientSettings , AmazonS3Reference > clientBuilder , Executor executor ) {
5454 this .nodeS3Settings = Settings .builder ()
55- .put (settings .getByPrefix (S3_SETTING_PREFIX ), false ) // not use any cluster scoped secrets
55+ .put (settings .getByPrefix (S3_SETTING_PREFIX ), false ) // not rely on any cluster scoped secrets
5656 .normalizePrefix (S3_SETTING_PREFIX )
5757 .build ();
5858 this .clientBuilder = clientBuilder ;
@@ -72,7 +72,7 @@ public void clusterChanged(ClusterChangedEvent event) {
7272 final List <ClientsHolder > clientsHoldersToClose = new ArrayList <>();
7373 for (var project : currentProjects .values ()) {
7474 final ProjectSecrets projectSecrets = project .custom (ProjectSecrets .TYPE );
75- // Project secrets can be null when node restarts. It may not have s3 credentials if s3 is not used .
75+ // Project secrets can be null when node restarts. It may not have any s3 credentials if s3 is not in use .
7676 if (projectSecrets == null || projectSecrets .getSettingNames ().stream ().noneMatch (key -> key .startsWith ("s3." ))) {
7777 // Most likely there won't be any existing client, but attempt to remove it anyway just in case
7878 final ClientsHolder removed = projectClientsHolders .remove (project .id ());
@@ -126,7 +126,7 @@ public void clusterChanged(ClusterChangedEvent event) {
126126 clientsHoldersToClose .add (removed );
127127 }
128128 }
129- // Close stale clients asynchronously without blocking the cluster state thread
129+ // Close stale clients asynchronously without blocking the applier thread
130130 if (clientsHoldersToClose .isEmpty () == false ) {
131131 final var currentClientsCloseListener = new SubscribableListener <Void >();
132132 final var previousClientsCloseListener = clientsCloseListener ;
@@ -182,7 +182,7 @@ public void close() {
182182 currentClientsCloseListener .addListener (ActionListener .running (latch ::countDown ));
183183 try {
184184 if (latch .await (1 , TimeUnit .MINUTES ) == false ) {
185- logger .warn ("async closing of s3 clients timed out" );
185+ logger .warn ("Waiting for async closing of s3 clients timed out" );
186186 }
187187 } catch (InterruptedException e ) {
188188 Thread .currentThread ().interrupt ();
0 commit comments