[ 
https://issues.apache.org/jira/browse/CASSANDRA-14871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16712822#comment-16712822
 ] 

Robert Stupp commented on CASSANDRA-14871:
------------------------------------------

Few comments:
 * I think [this 
lock|https://github.com/bdeggleston/cassandra/commit/7eeec9be03be6d326432fc715e9dce4b173acdf4#diff-b9ead760fa9628889810dd64e6507d9cR1279]
 has no "real" effect - mean, the method just returns the reference to 
{{topology}}. But we should make {{topology}} {{volatile}}. WDYT?
 * The builder-approach for {{Topology}} is nice!
 * Not sure how  
[this|https://github.com/bdeggleston/cassandra/commit/0a8f3909098a233bca42d651b8242b288bb2c557#diff-052bdc412f1a356a3fb5409de51dceb5R108]
 could actually help. It's definitely fine as a safety net though. WDYT about 
replacing it with {{assert type != null : "Parsing '" + str + "' yielded null, 
which is a bug";}} right before the {{synchronized}}.
 * +1 on the other changes!

 

> Severe concurrency issues in STCS,DTCS,TWCS,TMD.Topology,TypeParser
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-14871
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14871
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Critical
>             Fix For: 4.0, 3.0.x, 3.11.x
>
>
> There are a couple of places in the code base that do not respect that 
> j.u.HashMap + related classes are not thread safe and some parts rely on 
> internals of the implementation of HM, which can change.
> We have observed failures like {{NullPointerException}} and  
> {{ConcurrentModificationException}} as well as wrong behavior.
> Affected areas in the code base:
>  * {{SizeTieredCompactionStrategy}}
>  * {{DateTieredCompactionStrategy}}
>  * {{TimeWindowCompactionStrategy}}
>  * {{TokenMetadata.Topology}}
>  * {{TypeParser}}
>  * streaming / concurrent access to {{LifecycleTransaction}} (handled in 
> CASSANDRA-14554)
> While the patches for the compaction strategies + {{TypeParser}} are pretty 
> straight forward, the patch for {{TokenMetadata.Topology}} requires it to be 
> made immutable.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to