> On June 2, 2016, 10:58 p.m., Darrel Schneider wrote:
> > geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java,
> >  line 1024
> > <https://reviews.apache.org/r/48187/diff/1/?file=1405404#file1405404line1024>
> >
> >     failoverMap is synchronized but this code does not look threadsafe. 
> > Between the call of "containsKey" and "remove" another thread might do a 
> > remove of a non-null value but has not yet put it back in. Then this thread 
> > does its remove and sees it return null and does a put of null.
> >     
> >     I think you should bracket your containsKey, remove, and put calls with:
> >     synchronized (failoverMap) {
> >     }

Multiple threads working on the same txId would not happen, only one thread 
would get the TXStateProxy ReentrantLock to perform on a certain txId. Howver, 
I agree adding the synchronized keyword would be cleaner and it does not have 
performance penalty.


- Eric


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/48187/#review136004
-----------------------------------------------------------


On June 3, 2016, 12:05 a.m., Eric Shu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/48187/
> -----------------------------------------------------------
> 
> (Updated June 3, 2016, 12:05 a.m.)
> 
> 
> Review request for geode, Darrel Schneider and Swapnil Bawaskar.
> 
> 
> Bugs: GEODE-1491
>     https://issues.apache.org/jira/browse/GEODE-1491
> 
> 
> Repository: geode
> 
> 
> Description
> -------
> 
> Make sure when checking if a transaction is completed from 
> isHostedTxRecentlyCompleted() method, the rolled back transaction is 
> considered as well.
> Added a unit test that would fail without the fix and pass with the fix.
> 
> 
> Diffs
> -----
> 
>   
> geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
>  df0176d 
>   
> geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionMessage.java
>  9c54587 
>   
> geode-core/src/main/java/com/gemstone/gemfire/internal/cache/tier/sockets/command/RollbackCommand.java
>  ed7c706 
>   
> geode-core/src/test/java/com/gemstone/gemfire/internal/cache/TXManagerImplTest.java
>  a4b8127 
> 
> Diff: https://reviews.apache.org/r/48187/diff/
> 
> 
> Testing
> -------
> 
> precheckin.
> 
> 
> Thanks,
> 
> Eric Shu
> 
>

Reply via email to