> On April 28, 2017, 12:47 a.m., Alexander Kolbasov wrote: > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java > > Line 90 (original), 90 (patched) > > <https://reviews.apache.org/r/58812/diff/1/?file=1702074#file1702074line90> > > > > Do we need to worry about concurrent access? Can some other thread > > modify it while we read?
Each thread has its own provider instance, so we don't need to worry about the concurrent access of the provider instance. Those provider instances share the same user, which is static loginUser. That is why when first provider creates a credential, it flushes the credential to the user. Then the second provider gets credential from the user, and if we still create the credential to the second provider, exception is thrown because such credential is present already - Na ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/58812/#review173280 ----------------------------------------------------------- On April 27, 2017, 7:33 p.m., Na Li wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/58812/ > ----------------------------------------------------------- > > (Updated April 27, 2017, 7:33 p.m.) > > > Review request for sentry, Alexander Kolbasov, Hao Hao, kalyan kumar > kalvagadda, Sergio Pena, and Vamsee Yarlagadda. > > > Repository: sentry > > > Description > ------- > > Check if credential provider already has the credential before creating a > credential > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/provider/db/service/persistent/TestSentryStore.java > 31a309b > > > Diff: https://reviews.apache.org/r/58812/diff/1/ > > > Testing > ------- > > > Thanks, > > Na Li > >
