[
https://issues.apache.org/jira/browse/SOLR-3022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Dyer updated SOLR-3022:
-----------------------------
Attachment: SOLR-3022.patch
I had noticed that problem constructor in SolrException also. I think it needs
to be changed. Its used all over the place and in most cases, its a "new
SolrException" being created and subsequently not being logged. But why should
a developer have to dig through the constructors to check for gotchas like this?
Here's a patch that adds a new constructor so developers can specify their
intentions:
{code}
public SolrException(ErrorCode code, Throwable th, boolean alreadyLogged)
{code}
And also changes the problem constructor to:
{code}
public SolrException(ErrorCode code, Throwable th) {
super(th);
this.code=code.code;
if(th instanceof SolrException) {
this.logged=((SolrException) th).logged;
} else {
this.logged = false;
}
}
{code}
Reviewing all the places this is used, I left most of them alone but changed a
few to suppress logging (with the new constructor) in cases where the problem
is obviously being logged already. I also kept the suppressed logging for
caught&wrapped "InterrupedException"s.
Doing this will make the app a bit nosier but then again, each of these
exceptions will log only once (right?). If we apply this, I wouldn't be
surprised if there might be a case or two we will find it needs to be changed
back to suppress the log message. But these should be easy to handle
after-the-fact, right?
Problem is, I'm not sure if this handles the issue you've discovered, when you
have a bad RequestHandler in solrconfig.xml. I tried this with this new patch
applied and I still didn't get a meaningful message logged. I'm now trying to
get the latest trunk to deploy properly in my ide so I can debug...
> AbstractPluginLoader does not log caught exceptions
> ---------------------------------------------------
>
> Key: SOLR-3022
> URL: https://issues.apache.org/jira/browse/SOLR-3022
> Project: Solr
> Issue Type: Bug
> Affects Versions: 4.0
> Reporter: James Dyer
> Assignee: Erick Erickson
> Priority: Trivial
> Fix For: 4.0
>
> Attachments: SOLR-3022.patch, SOLR-3022.patch
>
>
> I was setting up a new 4.x environment but forgot to put a custom Analyzer in
> the classpath. Unfortunately AbstractPluginLoader didn't log the exception
> and it took a long time for me to figure out why "No cores were created".
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]