You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mark Miller (JIRA)" <ji...@apache.org> on 2015/10/24 17:50:27 UTC

[jira] [Commented] (SOLR-7423) Non thread safe use of WeakHashMap can hang in get method.

    [ https://issues.apache.org/jira/browse/SOLR-7423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972663#comment-14972663 ] 

Mark Miller commented on SOLR-7423:
-----------------------------------

This was changed in SOLR-8189
{noformat}
-  private static Map<SolrCore, EtagCacheVal> etagCoreCache
-    = new WeakHashMap<>();
+  private static Map<SolrCore, EtagCacheVal> etagCoreCache = Collections.synchronizedMap(new WeakHashMap<>());
{noformat}

> Non thread safe use of WeakHashMap can hang in get method.
> ----------------------------------------------------------
>
>                 Key: SOLR-7423
>                 URL: https://issues.apache.org/jira/browse/SOLR-7423
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Miller
>
> You can see this with some googling and I just saw it happen in TestSolrConfigHandler. A thread was stuck in HttpCacheHeaderUtil in the get for the WeakHashMap.
> Apache commons-beanutils has a WeakFastHashMap that is supposed to be thread safe and read efficient I think.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org