hemantk-12 commented on PR #5968: URL: https://github.com/apache/ozone/pull/5968#issuecomment-1885949336
> There can still be a case where this can result in a deadlock. For example, At time`t0` Thread 1 -> Acquires lock for `snap1` At time`t0` Thread 2 -> Acquires lock for `snap2` > > Now both the threads are doing the `cleanup()`, We may end up in a scenario. At time `t1` Thread 1 -> Waiting for lock `snap2` At time `t1` Thread 2 -> Waiting for lock `snap1` > Currently [cleanup](https://github.com/apache/ozone/pull/5968/files#diff-d5b0b24274c5d19e876dc2ffeb744d4965fa1a23ce727ac09b965f665573c18aR255) is synchronized at class level and should prevent this. Only one thread will be doing clean up at a time. I think we can move cleanup [here](https://github.com/apache/ozone/pull/5968/files#diff-d5b0b24274c5d19e876dc2ffeb744d4965fa1a23ce727ac09b965f665573c18aR208) out of the lock. -- 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]
