fapifta opened a new pull request, #4381:
URL: https://github.com/apache/ozone/pull/4381

   ## What changes were proposed in this pull request?
   
   The intent of the renewLock in the DefaultCertificateClient is to ensure no 
more than one thread changes the on disk certificate material at a given time. 
The problem is that the lock is belonging to an instance of the 
CertificateClient implementation, and with that there might be multiple 
instances from the lock.
   As we do not use any of the properties of a ReentrantLock, I simply think we 
should synchronize the renewal and the on disk operations on the class.
   In the meantime, I switched to shutdownNow instead of shutDown in the 
executor, after HDDS-8134 we do not have multiple executors running at the same 
time, but the service after close should not schedule any new runs but should 
finish the current run. This is not a foolproof implementation, but a good 
enough one for now. We are working on this code and there are further changes 
to how it is structured, so I think we should wait for the final form to get to 
a good solution, where only one executor is present per certificate material.
   
   An other warning is also fixed by this patch, as notificationReceivers are 
also guarded by a synchronized block locking on the Set itself, but the 
instance is not final. This is not really a problem, as we do not tackle with 
the instance anymore, but seemed to be something that we can fix together.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-8135
   
   ## How was this patch tested?
   Existing tests should suffice.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to