nickva commented on code in PR #6096:
URL: https://github.com/apache/couchdb/pull/6096#discussion_r3822772566
##########
extra/nouveau/src/main/java/org/apache/couchdb/nouveau/lucene/LuceneIndexSchema.java:
##########
@@ -56,6 +56,8 @@ private static Type fromField(final Field field) {
private final ConcurrentMap<String, Type> map;
+ private final ConcurrentMap<Locale, Map<String, PointsConfig>>
pointsConfigCache = new ConcurrentHashMap<>();
Review Comment:
This is caching a locale => number format instances to share between client
calls?
Since it seem to be shared I checked
https://lucene.apache.org/core/10_5_0/queryparser/org/apache/lucene/queryparser/flexible/standard/config/PointsConfig.html
and it doesn't mention any synchronization safety but the number format warns
about using them in different threads
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/text/NumberFormat.html#synchronization
maybe it need a lock or if you looked and think it's fine it's ok. I am just
going by superficial impressions and docs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]