[
https://issues.apache.org/jira/browse/SOLR-9244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347349#comment-15347349
]
Gary Lee edited comment on SOLR-9244 at 6/23/16 10:39 PM:
----------------------------------------------------------
SOLR-8657 appears to detail another path in which the same issue occurs - lots
of those errors polluting the logs. In our case it seems that HttpSolrCall.call
isn't properly clearing the SolrRequestInfo. See where I added a call to clear
the request info below:
{noformat}
public Action call() throws IOException {
MDCLoggingContext.reset();
MDCLoggingContext.setNode(cores);
if (cores == null) {
sendError(503, "Server is shutting down or failed to initialize");
return RETURN;
}
if (solrDispatchFilter.abortErrorMessage != null) {
sendError(500, solrDispatchFilter.abortErrorMessage);
return RETURN;
}
try {
init();
...
SolrRequestInfo.setRequestInfo(new SolrRequestInfo(solrReq,
solrRsp));
execute(solrRsp);
HttpCacheHeaderUtil.checkHttpCachingVeto(solrRsp, resp, reqMethod);
Iterator<Map.Entry<String, String>> headers = solrRsp.httpHeaders();
while (headers.hasNext()) {
Map.Entry<String, String> entry = headers.next();
resp.addHeader(entry.getKey(), entry.getValue());
}
QueryResponseWriter responseWriter =
core.getQueryResponseWriter(solrReq);
if (invalidStates != null)
solrReq.getContext().put(CloudSolrClient.STATE_VERSION, invalidStates);
writeResponse(solrRsp, responseWriter, reqMethod);
}
return RETURN;
default: return action;
}
} catch (Throwable ex) {
sendError(ex);
// walk the the entire cause chain to search for an Error
Throwable t = ex;
while (t != null) {
if (t instanceof Error) {
if (t != ex) {
log.error("An Error was wrapped in another exception - please
report complete stacktrace on SOLR-6161", ex);
}
throw (Error) t;
}
t = t.getCause();
}
return RETURN;
} finally {
// I WOULD HAVE EXPECTED SolrRequestInfo.clearRequestInfo(); call here
MDCLoggingContext.clear();
}
}
{noformat}
So yes appears to be the same issue as SOLR-8657, but this details another code
path that needs to be addressed.
was (Author: gary.lee):
SOLR-8657 appears to detail another path in which the same issue occurs - lots
of those errors polluting the logs. In our case it seems that HttpSolrCall.call
isn't properly clearing the SolrRequestInfo:
{noformat}
public Action call() throws IOException {
MDCLoggingContext.reset();
MDCLoggingContext.setNode(cores);
if (cores == null) {
sendError(503, "Server is shutting down or failed to initialize");
return RETURN;
}
if (solrDispatchFilter.abortErrorMessage != null) {
sendError(500, solrDispatchFilter.abortErrorMessage);
return RETURN;
}
try {
init();
...
SolrRequestInfo.setRequestInfo(new SolrRequestInfo(solrReq,
solrRsp));
execute(solrRsp);
HttpCacheHeaderUtil.checkHttpCachingVeto(solrRsp, resp, reqMethod);
Iterator<Map.Entry<String, String>> headers = solrRsp.httpHeaders();
while (headers.hasNext()) {
Map.Entry<String, String> entry = headers.next();
resp.addHeader(entry.getKey(), entry.getValue());
}
QueryResponseWriter responseWriter =
core.getQueryResponseWriter(solrReq);
if (invalidStates != null)
solrReq.getContext().put(CloudSolrClient.STATE_VERSION, invalidStates);
writeResponse(solrRsp, responseWriter, reqMethod);
}
return RETURN;
default: return action;
}
} catch (Throwable ex) {
sendError(ex);
// walk the the entire cause chain to search for an Error
Throwable t = ex;
while (t != null) {
if (t instanceof Error) {
if (t != ex) {
log.error("An Error was wrapped in another exception - please
report complete stacktrace on SOLR-6161", ex);
}
throw (Error) t;
}
t = t.getCause();
}
return RETURN;
} finally {
// I WOULD HAVE EXPECTED SolrRequestInfo.clearRequestInfo(); call here
MDCLoggingContext.clear();
}
}
{noformat}
So yes appears to be the same issue as SOLR-8657, but this details another code
path that needs to be addressed.
> Lots of "Previous SolrRequestInfo was not closed" in Solr log
> -------------------------------------------------------------
>
> Key: SOLR-9244
> URL: https://issues.apache.org/jira/browse/SOLR-9244
> Project: Solr
> Issue Type: Bug
> Components: Server
> Affects Versions: 5.3.1
> Reporter: Gary Lee
> Priority: Minor
> Fix For: 5.3.1
>
>
> After upgrading to Solr 5.3.1, we started seeing a lot of "Previous
> SolrRequestInfo was not closed" ERROR level messages in the logs. Upon
> further inspection, it appears this is a sanity check and not an error that
> needs attention. It appears that the SolrRequestInfo isn't freed in one
> particular path (no corresponding call to SolrRequestInfo.clearRequestInfo in
> HttpSolrCall.call), which often leads to a lot of these messages.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]