[ 
https://issues.apache.org/jira/browse/LUCENE-9967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17350515#comment-17350515
 ] 

Steven Schlansker commented on LUCENE-9967:
-------------------------------------------

Awesome!  Happy to help.  Thanks for the review.  I agree the code isn't the 
best, but exception handlers can be fantastically tricky to get the behavior 
you want so I made the minimal change to fix the issue for now to reduce risk 
of any regression.

> ReplicaNode.start NPE on exception with no message
> --------------------------------------------------
>
>                 Key: LUCENE-9967
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9967
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/replicator
>    Affects Versions: 8.8.2
>         Environment: Java 16.0.1, Fedora Linux 33
>            Reporter: Steven Schlansker
>            Priority: Major
>              Labels: easyfix, patch
>             Fix For: 8.9
>
>         Attachments: LUCENE-9967.patch
>
>
> We are starting a new project and trying to implement Lucene near real time 
> replication.
> While stubbing out some code such that it throws an exception, we found that 
> Lucene's error handling itself fails when the exception has no message:
>  
> {code:java}
>     } catch (Throwable t) {
>       if (t.getMessage().startsWith("replica cannot start") == false) {{code}
>  
> This obscures the actual root cause exception source (you cannot see it 
> without a debugger) and replaces it with a useless NPE.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to