HoustonPutman opened a new pull request, #1657:
URL: https://github.com/apache/solr/pull/1657

   I can create a JIRA for this if we decide to move forward.
   
   Basically I had an issue when debugging a new CollectionsAPI command, that 
reading the output of a 500 error was very difficult since the stack trace was 
added as a string.
   
   If we instead made the stacktrace a JSON object, reading it becomes much 
easier.
   
   To not impact back-compat, this only affects V2 endpoints, which use the 
ErrorInfo class.
   
   
   Old:
   
   ```
   {
     "responseHeader": {
       "status": 500,
       "QTime": 20759
     },
     "error": {
       "metadata": {
         "error-class": "org.apache.solr.common.SolrException",
         "root-error-class": "org.apache.solr.common.SolrException"
       },
       "msg": "Could not find replica when balancing: 
ReplicaImpl{replicaName='core_node8', coreName='test_shard1_replica_n7', 
shard='shard1', replicaType=NRT, replicaState=DOWN, 
node='NodeImpl(localhost:8983_solr)'}",
       "trace": "org.apache.solr.common.SolrException: Could not find replica 
when balancing: ReplicaImpl{replicaName='core_node8', 
coreName='test_shard1_replica_n7', shard='shard1', replicaType=NRT, 
replicaState=DOWN, node='NodeImpl(localhost:8983_solr)'}\n\tat 
org.apache.solr.client.solrj.SolrResponse.getException(SolrResponse.java:56)\n\tat
 
org.apache.solr.handler.admin.api.BalanceReplicasAPI.balanceReplicas(BalanceReplicasAPI.java:84)\n\tat
 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)\n\tat 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat
 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
 java.base/java.lang.reflect.Method.invoke(Method.java:566)\n\tat 
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)\n\tat
 org.glassfish.jersey.server.model
 
.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)\n\tat
 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)\n\tat
 
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219)\n\tat
 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)\n\tat
 
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)\n\tat
 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)\n\tat
 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)\n\tat
 org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)\n\tat 
org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)\n\tat org.gl
 assfish.jersey.internal.Errors$1.call(Errors.java:244)\n\tat 
org.glassfish.jersey.internal.Errors.process(Errors.java:292)\n\tat 
org.glassfish.jersey.internal.Errors.process(Errors.java:274)\n\tat 
org.glassfish.jersey.internal.Errors.process(Errors.java:244)\n\tat 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)\n\tat
 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)\n\tat 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:684)\n\tat
 org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:384)\n\tat 
org.apache.solr.api.V2HttpCall.invokeJerseyRequest(V2HttpCall.java:348)\n\tat 
org.apache.solr.api.V2HttpCall.handleAdmin(V2HttpCall.java:433)\n\tat 
org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:870)\n\tat
 org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:541)\n\tat 
org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:250)\n\tat
 org
 
.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:218)\n\tat
 
org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:257)\n\tat
 
org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:227)\n\tat
 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)\n\tat
 
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)\n\tat
 org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)\n\tat 
org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)\n\tat
 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)\n\tat
 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)\n\tat
 
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)\n\tat
 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
 org.eclipse.jetty.server.handler.ScopedHandler.nextHandl
 e(ScopedHandler.java:223)\n\tat 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)\n\tat
 
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)\n\tat
 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1385)\n\tat
 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)\n\tat
 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)\n\tat 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)\n\tat
 
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)\n\tat
 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1307)\n\tat
 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)\n\tat
 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)\n\tat
 org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.jav
 a:228)\n\tat 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:141)\n\tat
 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
 
org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:301)\n\tat
 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
 
org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:822)\n\tat
 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)\n\tat
 org.eclipse.jetty.server.Server.handle(Server.java:563)\n\tat 
org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505)\n\tat
 org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762)\n\tat 
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497)\n\tat 
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)\n\tat
 
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
 \n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)\n\tat 
org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)\n\tat
 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:416)\n\tat
 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:385)\n\tat
 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:272)\n\tat
 
org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.produce(AdaptiveExecutionStrategy.java:194)\n\tat
 
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:936)\n\tat
 
org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1080)\n\tat
 java.base/java.lang.Thread.run(Thread.java:829)\n",
       "code": 500
     }
   }
   ```
   
   New:
   
   ```
   {
     "responseHeader": {
       "status": 500,
       "QTime": 117
     },
     "error": {
       "metadata": {
         "error-class": "org.apache.solr.common.SolrException",
         "root-error-class": "org.apache.solr.common.SolrException"
       },
       "msg": "Could not find replica when balancing: 
ReplicaImpl{replicaName='core_node3', coreName='test_shard3_replica_n1', 
shard='shard3', replicaType=NRT, replicaState=ACTIVE, 
node='NodeImpl(localhost:7574_solr)'}",
       "code": 500,
       "trace": {
         "stackTrace": [
           
"org.apache.solr.client.solrj.SolrResponse.getException(SolrResponse.java:56)",
           
"org.apache.solr.handler.admin.api.BalanceReplicasAPI.balanceReplicas(BalanceReplicasAPI.java:84)",
           
"java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)",
           (shortened for readability)
         ]
       }
     }
   }
   ```


-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to