From issues-return-4705-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Nov 15 19:36:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 91E05180658 for ; Fri, 15 Nov 2019 20:36:02 +0100 (CET) Received: (qmail 57351 invoked by uid 500); 15 Nov 2019 19:36:02 -0000 Mailing-List: contact issues-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list issues@lucene.apache.org Received: (qmail 57338 invoked by uid 99); 15 Nov 2019 19:36:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Nov 2019 19:36:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 34024E2C1A for ; Fri, 15 Nov 2019 19:36:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 993827801CA for ; Fri, 15 Nov 2019 19:36:00 +0000 (UTC) Date: Fri, 15 Nov 2019 19:36:00 +0000 (UTC) From: "ASF subversion and git services (Jira)" To: issues@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-13898) Non-atomic use of SolrCache get / put MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-13898?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1697= 5345#comment-16975345 ]=20 ASF subversion and git services commented on SOLR-13898: -------------------------------------------------------- Commit 4d1fff37fc799035e5294cb274761a662a70fa61 in lucene-solr's branch ref= s/heads/branch_8x from Andrzej Bialecki [ https://gitbox.apache.org/repos/asf?p=3Dlucene-solr.git;h=3D4d1fff3 ] SOLR-13898: Allow inexact double comparison. Close resources. > Non-atomic use of SolrCache get / put > ------------------------------------- > > Key: SOLR-13898 > URL: https://issues.apache.org/jira/browse/SOLR-13898 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public)=20 > Affects Versions: 8.3 > Reporter: Andrzej Bialecki > Assignee: Andrzej Bialecki > Priority: Major > Fix For: 8.4 > > Attachments: SOLR-13898.patch, SOLR-13898.patch, SOLR-13898.patch > > > As pointed out by [~ben.manes]=C2=A0in SOLR-13817 Solr code base in many = key places uses a similar pattern of non-atomic get / put calls to SolrCach= e-s. In multi-threaded environment this leads to cache misses and additiona= l unnecessary computations when competing threads both discover a missing v= alue, non-atomically compute it and update the cache. > Some of these places are known performance bottlenecks where efficient ca= ching is especially important, such as {{SolrIndexSearcher}}, {{SolrDocumen= tFetcher}}, {{UninvertedField}} and join queries . > I propose to add {{SolrCache.computeIfAbsent(key, mappingFunction)}} that= will atomically retrieve existing values or compute and update the cache. = This will require also changing how the {{SolrCache.get(...)}}=C2=A0is used= in many components. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org For additional commands, e-mail: issues-help@lucene.apache.org