> On Oct. 17, 2024, 6:14 a.m., Vyom Tiwari wrote: > > agents-common/src/main/java/org/apache/ranger/plugin/util/ServiceTags.java > > Line 261 (original), 261 (patched) > > <https://reviews.apache.org/r/75232/diff/1/?file=2293802#file2293802line261> > > > > Is this change intentional?. I can see we are incrementing the > > reference count "cachedTag.right++ at line 301".
Yes, this is intentional. cachedTag.right is the reference-count, and gets incremented at #301 only when another instance refers to this tag. - Madhan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/75232/#review226976 ----------------------------------------------------------- On Oct. 17, 2024, 1:29 a.m., Madhan Neethiraj wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/75232/ > ----------------------------------------------------------- > > (Updated Oct. 17, 2024, 1:29 a.m.) > > > Review request for ranger, Abhishek Kumar, Anand Nadar, Asit Vadhavkar, > Fateh Singh, Abhay Kulkarni, Pradeep Agrawal, Radhika Kundam, Ramesh Mani, > and Sailaja Polavarapu. > > > Bugs: RANGER-4956 > https://issues.apache.org/jira/browse/RANGER-4956 > > > Repository: ranger > > > Description > ------- > > - dedupTags() on a ServiceTag instance can result in infinite loop when its > cachedTags is already populated (by an earlier call or via a copy > constructor), as it tries to replace a tag with itself. Updated to avoid such > replacement. > > > Diffs > ----- > > agents-common/src/main/java/org/apache/ranger/plugin/util/ServiceTags.java > cc2ebe53a > > agents-common/src/test/java/org/apache/ranger/plugin/util/TestServiceTags.java > PRE-CREATION > > > Diff: https://reviews.apache.org/r/75232/diff/1/ > > > Testing > ------- > > - added unit tests to verify dedupTags() > - verified that all unit tests pass > > > Thanks, > > Madhan Neethiraj > >