-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
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
CLDR-17014 Make ExtraPaths.getInstance synchronized #4317
base: main
Are you sure you want to change the base?
Conversation
-ConcurrentModificationException was thrown when ExtraPaths.getInstance called computeIfAbsent during cldr-generate-json.sh -Unable to repro the exception before making this change; anyway, this should prevent it
FYI the stack trace was as follows, called from
|
Alternatively, maybe could use ConcurrentHashMap... |
Compare alternative #4321 which uses ConcurrentHashMap -- but fails |
This looks very strange. The extra paths that are added here are all static. That is, they do not depend on any locale data, just on stuff like StandardCodes, which don't vary by locale, and don't vary during any Survey Tool or ConsoleCheck run. Since they can all be built statically, once, it should be just reformulated to be Bill Pugh Singleton, which is thread-safe and avoids the synchronization overhead. @srl295 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See ticket
First of all, the code change itself here makes sense - the collision was on the hash, and this synchronizes the hash. So merging this PR might make sense to remove the collision immediately.. However, I could only find one call site, in CLDRFile: ExtraPaths.getInstance(NameType.LANGUAGE).append(toAddTo);
ExtraPaths.getInstance(NameType.SCRIPT).append(toAddTo); So instead of making ExtraPaths synchronized, we could just remove |
-ConcurrentModificationException was thrown when ExtraPaths.getInstance called computeIfAbsent during cldr-generate-json.sh
-Unable to repro the exception before making this change; anyway, this should prevent it
CLDR-17014
ALLOW_MANY_COMMITS=true