You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2020/11/18 08:48:00 UTC
[jira] [Updated] (RATIS-1163) RefCountingMap is not thread-safe
[ https://issues.apache.org/jira/browse/RATIS-1163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tsz-wo Sze updated RATIS-1163:
------------------------------
Description:
- The refCount field in RefCountingMap.Payload is not thread-safe.
{code}
//RefCountingMap.Payload
private int refCount;
{code}
- Also, there are a few javac warnings in ratis-metrics.
{code}
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[51,15] [unchecked] unchecked call to Payload(V) as a member of the raw type Payload
where V is a type-variable:
V extends Object declared in class Payload
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[46,35] [unchecked] unchecked method invocation: method compute in class ConcurrentHashMap is applied to given types
required: K#1,BiFunction<? super K#1,? super V#1,? extends V#1>
found: K#2,BiFunction<K#2,Payload<V#2>,Payload<V#2>>
where K#1,V#1,K#2,V#2 are type-variables:
K#1 extends Object declared in class ConcurrentHashMap
V#1 extends Object declared in class ConcurrentHashMap
K#2 extends Object declared in class RefCountingMap
V#2 extends Object declared in class RefCountingMap
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[46,35] [unchecked] unchecked cast
required: Payload<V>
found: Payload
where V is a type-variable:
V extends Object declared in class RefCountingMap
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/MetricRegistriesLoader.java:[68,81] [unchecked] unchecked cast
required: Class<MetricRegistries>
found: Class<CAP#1>
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
[INFO]
{code}
was:
{code}
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[51,15] [unchecked] unchecked call to Payload(V) as a member of the raw type Payload
where V is a type-variable:
V extends Object declared in class Payload
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[46,35] [unchecked] unchecked method invocation: method compute in class ConcurrentHashMap is applied to given types
required: K#1,BiFunction<? super K#1,? super V#1,? extends V#1>
found: K#2,BiFunction<K#2,Payload<V#2>,Payload<V#2>>
where K#1,V#1,K#2,V#2 are type-variables:
K#1 extends Object declared in class ConcurrentHashMap
V#1 extends Object declared in class ConcurrentHashMap
K#2 extends Object declared in class RefCountingMap
V#2 extends Object declared in class RefCountingMap
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[46,35] [unchecked] unchecked cast
required: Payload<V>
found: Payload
where V is a type-variable:
V extends Object declared in class RefCountingMap
[WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/MetricRegistriesLoader.java:[68,81] [unchecked] unchecked cast
required: Class<MetricRegistries>
found: Class<CAP#1>
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
[INFO]
{code}
Priority: Major (was: Minor)
Summary: RefCountingMap is not thread-safe (was: Fix javac warnings in ratis-metrics)
> RefCountingMap is not thread-safe
> ---------------------------------
>
> Key: RATIS-1163
> URL: https://issues.apache.org/jira/browse/RATIS-1163
> Project: Ratis
> Issue Type: Bug
> Components: metrics
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
>
> - The refCount field in RefCountingMap.Payload is not thread-safe.
> {code}
> //RefCountingMap.Payload
> private int refCount;
> {code}
> - Also, there are a few javac warnings in ratis-metrics.
> {code}
> [WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[51,15] [unchecked] unchecked call to Payload(V) as a member of the raw type Payload
> where V is a type-variable:
> V extends Object declared in class Payload
> [WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[46,35] [unchecked] unchecked method invocation: method compute in class ConcurrentHashMap is applied to given types
> required: K#1,BiFunction<? super K#1,? super V#1,? extends V#1>
> found: K#2,BiFunction<K#2,Payload<V#2>,Payload<V#2>>
> where K#1,V#1,K#2,V#2 are type-variables:
> K#1 extends Object declared in class ConcurrentHashMap
> V#1 extends Object declared in class ConcurrentHashMap
> K#2 extends Object declared in class RefCountingMap
> V#2 extends Object declared in class RefCountingMap
> [WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java:[46,35] [unchecked] unchecked cast
> required: Payload<V>
> found: Payload
> where V is a type-variable:
> V extends Object declared in class RefCountingMap
> [WARNING] /Users/tszwosze/ratis/apache-ratis/ratis-metrics/src/main/java/org/apache/ratis/metrics/MetricRegistriesLoader.java:[68,81] [unchecked] unchecked cast
> required: Class<MetricRegistries>
> found: Class<CAP#1>
> where CAP#1 is a fresh type-variable:
> CAP#1 extends Object from capture of ?
> [INFO]
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)