Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 37AA7200B34 for ; Sat, 2 Jul 2016 10:26:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 36320160A5F; Sat, 2 Jul 2016 08:26:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7DE27160A50 for ; Sat, 2 Jul 2016 10:26:53 +0200 (CEST) Received: (qmail 72052 invoked by uid 500); 2 Jul 2016 08:26:51 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 72040 invoked by uid 99); 2 Jul 2016 08:26:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Jul 2016 08:26:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 27904C01A9 for ; Sat, 2 Jul 2016 08:26:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3YczjAYPo136 for ; Sat, 2 Jul 2016 08:26:49 +0000 (UTC) Received: from mail-vk0-f67.google.com (mail-vk0-f67.google.com [209.85.213.67]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id DC7185F245 for ; Sat, 2 Jul 2016 08:26:48 +0000 (UTC) Received: by mail-vk0-f67.google.com with SMTP id v6so18663945vkb.1 for ; Sat, 02 Jul 2016 01:26:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=KCqTmwBeL7f4HWo6FlQVlwroLQWQQ+u60cULHKt0La0=; b=ogwxxC5IDEf9TXGRgExamuUK1AkS4lNEzdmd3UuWsg1SWzPM+NorYHLqYsqdCK/maZ NIUZH1amVa98sfNksKQi6ir8q9xunXmK5MbSYe3W7zOEQ0H9PX2nw7gsXhVX2ScJ1H4g oNwSQddXQDwpF8ygTLVbXO3l6xnSsRDgR3EWKOsnT/a2S7Ckp67lSHvalZiH3oBahu0R UiTMZL5i7/tKVKjBiCenlvjv1F50P7aaYJ7ZMKu3CLG67ot5ZhZ80VDAlXrWrsEieciX k00r/y4yzB1Pq9M5Bm2SPQt41kCPP7QxK9HgFzsKKXhr/D0BNHhedghttAdUtTIO/Cp+ ACmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=KCqTmwBeL7f4HWo6FlQVlwroLQWQQ+u60cULHKt0La0=; b=BXON4ZG440/7dZXTQldT/VrEE0IVXfNfCZFNpj5ly/pxmFM3Q9pcpHKh9QHX6oWvzS eqiciLktf6c+ceG9PICzF2Eu5iAx8a5BfphRKLLTMmI96+6PoxReSf0xvpQ4jihwdbmD F1aThQBZsNLWx3eDmIFNIpSpvQqJ0EFw9tMDdjAACileHH3b9o4UmaHGe8yZNgD6cYzZ eXDtGDDi63pLHZpG+2CMidvsjnx4xmcxrI2hlL+xmbQqok5LmW7s0A2i6+omzxBRYqI7 Yu7uecu+GM+b69TlqRsvC/WcfJoLlhYzlMSM/EDFO1Ocpk5EVj175uG/QI2vXkddZ92Y SFwA== X-Gm-Message-State: ALyK8tLRRSwq0M/v0ZyPQM5t6A9E7QyCGVRr7B/Y61zWvngvxGYWuIQZbXoqIdvgJdLXwRyw0oCzvSuhIvCDSA== X-Received: by 10.31.96.207 with SMTP id u198mr898067vkb.50.1467448001688; Sat, 02 Jul 2016 01:26:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.39.100 with HTTP; Sat, 2 Jul 2016 01:26:41 -0700 (PDT) In-Reply-To: <2b240226-e973-0db1-35e9-4bab648873bc@elyograg.org> References: <2b240226-e973-0db1-35e9-4bab648873bc@elyograg.org> From: Kent Mu Date: Sat, 2 Jul 2016 16:26:41 +0800 Message-ID: Subject: Re: solr shutdown error To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001a114e23f4ddf9580536a2dc0d archived-at: Sat, 02 Jul 2016 08:26:54 -0000 --001a114e23f4ddf9580536a2dc0d Content-Type: text/plain; charset=UTF-8 Thanks for your reply! I do understand your explaination, but another question accurs, When I create CloudSolrServer Connection by singleton pattern like this, and I call shutdown, but it's OK. the solr version is 4.9.0. that's why? public synchronized static CloudSolrServer getSolrCloudReadServer() { if (reviewSolrCloudServer == null) { ModifiableSolrParams params = new ModifiableSolrParams(); params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 10000); params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 500); HttpClient client = HttpClientUtil.createClient(params); LBHttpSolrServer lbServer = new LBHttpSolrServer(client); lbServer.setConnectionTimeout(ReviewProperties.getCloudConnectionTimeOut()); lbServer.setSoTimeout(ReviewProperties.getCloudSoTimeOut()); reviewSolrCloudServer = new CloudSolrServer(ReviewProperties.getZkHost(),lbServer); reviewSolrCloudServer.setDefaultCollection("commodityReview"); reviewSolrCloudServer.setZkClientTimeout(ReviewProperties.getZkClientTimeout()); reviewSolrCloudServer.setZkConnectTimeout(ReviewProperties.getZkConnectTimeout()); reviewSolrCloudServer.connect(); } return reviewSolrCloudServer; } 2016-07-02 14:22 GMT+08:00 Shawn Heisey : > On 7/1/2016 10:59 PM, Kent Mu wrote: > > solr version: 4.9.0 I create and get a HttpSolrServer connection by > > singleton pattern. I find the method of "shutdown" in solrj API, so I > > decided to use "shutdown" to release resources, but I got the error as > > below, It is due to singleton pattern? > > If you call shutdown, that client object can no longer be used. You > will need to make a new one. > > The expected usage pattern for the client object is that you will create > one object when the program starts and use it for all threads until the > program exits. Whether or not to use the singleton pattern for that is > up to you. Usually the only time you would call shutdown is just before > program exit ... but if the program is exiting, shutdown isn't really > necessary. > > If you are in a situation where client objects are being regularly > created, then you would want to do shutdown on each of them when you are > finished so you don't have a resource leak. Creating many client > objects is not recommended. > > Thanks, > Shawn > > --001a114e23f4ddf9580536a2dc0d--