adoroszlai commented on code in PR #5407:
URL: https://github.com/apache/ozone/pull/5407#discussion_r1363391720


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/OzoneDelegationTokenSecretManager.java:
##########
@@ -564,6 +564,9 @@ public synchronized void start(CertificateClient certClient)
       throws IOException {
     super.start(certClient);
     tokenRemoverThread = new Daemon(new ExpiredTokenRemover());
+    tokenRemoverThread.setName(
+        ozoneManager.getThreadNamePrefix() +
+            "ExpiredTokenRemover");
     tokenRemoverThread.start();

Review Comment:
   Findbugs started complaining about:
   
   ```
   M M IS: Inconsistent synchronization of 
org.apache.hadoop.ozone.security.OzoneDelegationTokenSecretManager.tokenRemoverThread;
 locked 42% of time  Unsynchronized access at 
OzoneDelegationTokenSecretManager.java:[line 579]
   ```
   
   
https://github.com/ArafatKhan2198/ozone/actions/runs/6557280070/job/17808617110#step:7:11
   
   I think the warning is correct, though it should have complained about this 
earlier (the PR does not change synchronization).
   
   Let's try fixing it:
    * change `public void stop()` to `public synchronized void stop()`
    * change `public void stopThreads()` to `private`



-- 
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