We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I submitted a CR for this issue:
#43839
The field fileDetails (a HashMap, i.e., not thread safe)
fileDetails
HashMap
https:/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L679
is used only in synchronzied methods (in about 20 locations), e.g.,:
https:/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L767-L768
i.e., including .size().
.size()
This is correct, because according to JDK:
If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally.
https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html
However, in the 21st location, here:
https:/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L958
the method is not synchronized.
This CR simply adds the keyword synchronized to the method, just like for all the other places.
The text was updated successfully, but these errors were encountered:
Pinging @elastic/es-distributed
Sorry, something went wrong.
8e413f8
Ensure to access RecoveryState#fileDetails under lock
cff0274
Closes #43840
No branches or pull requests
I submitted a CR for this issue:
#43839
The field
fileDetails
(aHashMap
, i.e., not thread safe)https:/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L679
is used only in synchronzied methods (in about 20 locations), e.g.,:
https:/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L767-L768
i.e., including
.size()
.This is correct, because according to JDK:
https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html
However, in the 21st location, here:
https:/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/indices/recovery/RecoveryState.java#L958
the method is not synchronized.
This CR simply adds the keyword synchronized to the method, just like for all the other places.
The text was updated successfully, but these errors were encountered: