[
https://issues.apache.org/jira/browse/CASSANDRA-14871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713122#comment-16713122
]
Blake Eggleston commented on CASSANDRA-14871:
---------------------------------------------
thanks for taking a look Robert.
bq. I think this lock has no "real" effect - mean, the method just returns the
reference to topology. But we should make topology volatile. WDYT?
Agreed, fixed.
bq. Not sure how this 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.
Right, it's just to quickly catch future bugs. I'd prefer to keep it as is if
that's ok with you. Right now it's verifying the entire un-cached case up to
and including the caching of the type. Regarding using {{assert}}, I avoid it
outside of tests because asserts can be disabled, and {{Preconditions}} and
{{Verify}} do a better job of communicating what you're checking (imo).
> 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]