[
https://issues.apache.org/jira/browse/NIFI-6744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard resolved NIFI-6744.
----------------------------------
Resolution: Feedback Received
Apache NiFi 1.x is no longer maintained and no new release is planned on the
1.x release line. Marking as resolved as part of a cleanup operation. Please
open a new one with an updated description if this is still relevant for NiFi
2.x.
> PutSolrContentStream Processor does not route to connection_failure in Cloud
> mode if Zookeeper is not running
> -------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-6744
> URL: https://issues.apache.org/jira/browse/NIFI-6744
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.9.2
> Reporter: Yuriy Flyud
> Priority: Major
>
> Solr processors would not detect connection failure in case ZK is not
> running. When this happens a SolrException is thrown. The following causes
> should route a flow file to a connection_failure:
> * java.util.concurren.TimeoutException - when ZK was down during Solr
> processor start
> * org.apache.zookeeper.KeeperException.ConnectionLossException - when ZK
> stopped after Solr processor was started and connection established.
> This could be fixed by implementing a SolrException handling in the following
> way:
> {code:java}
> catch (SolrException e) {
> //Additional handling of ZK connection exceptions.
> if (causedByException(e, TimeoutException.class) || causedByException(e,
> ConnectionLossException.class)) {
> connectionError.set(e);
> } else {
> error.set(e);
> }
> ...
> private boolean causedByException(Exception e, Class<? extends Exception> ec)
> {
> boolean foundException = false;
> Throwable cause = e.getCause();
> while (cause != null) {
> if (ec.isInstance(cause)) {
> foundException = true;
> break;
> }
> cause = cause.getCause();
> }
> return foundException;
> }{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)