lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jd...@apache.org
Subject svn commit: r1302970 - in /lucene/dev/trunk/solr: CHANGES.txt solrj/src/java/org/apache/solr/common/SolrException.java
Date Tue, 20 Mar 2012 16:18:11 GMT
Author: jdyer
Date: Tue Mar 20 16:18:11 2012
New Revision: 1302970

URL: http://svn.apache.org/viewvc?rev=1302970&view=rev
Log:
SOLR-2124:  do not log stack trace for Service Disabled / 503

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/SolrException.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1302970&r1=1302969&r2=1302970&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Tue Mar 20 16:18:11 2012
@@ -690,7 +690,10 @@ Bug Fixes
   package name (org.apache.commons.csv). This created a compatibility issue as
   the Apache Commons team works toward an official release of Commons CSV.
   JARJAR (http://code.google.com/p/jarjar/) was used to change the package name
-  to org.apache.solr.internal.csv.  (Uwe Schindler, Emmanuel Bourg)
+  to org.apache.solr.internal.csv.  (Uwe Schindler, Emmanuel Bourg)  
+ 
+* SOLR-2124: Do not log stack traces for "Service Disabled" / 503 Exceptions (PingRequestHandler,
etc)
+  (James Dyer, others)
 
 Other Changes
 ----------------------

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/SolrException.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/SolrException.java?rev=1302970&r1=1302969&r2=1302970&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/SolrException.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/common/SolrException.java Tue Mar
20 16:18:11 2012
@@ -75,6 +75,10 @@ public class SolrException extends Runti
 
   public void log(Logger log) { log(log,this); }
   public static void log(Logger log, Throwable e) {
+    if (e instanceof SolrException
+        && ((SolrException) e).code() == ErrorCode.SERVICE_UNAVAILABLE.code) {
+      return;
+    }
     String stackTrace = toStr(e);
     String ignore = doIgnore(e, stackTrace);
     if (ignore != null) {
@@ -86,6 +90,10 @@ public class SolrException extends Runti
   }
 
   public static void log(Logger log, String msg, Throwable e) {
+    if (e instanceof SolrException
+        && ((SolrException) e).code() == ErrorCode.SERVICE_UNAVAILABLE.code) {
+      log(log, msg);
+    }
     String stackTrace = msg + ':' + toStr(e);
     String ignore = doIgnore(e, stackTrace);
     if (ignore != null) {
@@ -109,7 +117,7 @@ public class SolrException extends Runti
   @Override
   public String toString() { return super.toString(); }
 
-  public static String toStr(Throwable e) {
+  public static String toStr(Throwable e) {   
     CharArrayWriter cw = new CharArrayWriter();
     PrintWriter pw = new PrintWriter(cw);
     e.printStackTrace(pw);



Mime
View raw message