You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Peter Turcsanyi (Jira)" <ji...@apache.org> on 2020/06/30 20:00:00 UTC

[jira] [Updated] (NIFI-7590) CassandraSessionProvider breaks after disable + re-enable

     [ https://issues.apache.org/jira/browse/NIFI-7590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Turcsanyi updated NIFI-7590:
----------------------------------
    Component/s: Extensions

> CassandraSessionProvider breaks after disable + re-enable
> ---------------------------------------------------------
>
>                 Key: NIFI-7590
>                 URL: https://issues.apache.org/jira/browse/NIFI-7590
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Tamas Palfy
>            Assignee: Tamas Palfy
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> If Cassandra processors are using CassandraSessionProvider service and the service is disabled and then re-enabled (typically when one want's to edit it's properties), the service cannot connect to Cassandra any longer and the processor keeps failing.
> Currently the only way to fix this is to restart NiFi.
> The root cause is a bug in the @OnDisabled and @OnEnabled:
> {code:java}
>     @OnDisabled
>     public void onDisabled(){
>         if (cassandraSession != null) {
>             cassandraSession.close();
>         }
>         if (cluster != null) {
>             cluster.close();
>         }
>     }
>     @OnEnabled
>     public void onEnabled(final ConfigurationContext context) {
>         connectToCassandra(context);
>     }
>     private void connectToCassandra(ConfigurationContext context) {
>         if (cluster == null) {
>         ...
> {code}
> In @OnDisabled, cluster is _closed_ but _not set to null_.
> In @OnEnabled, it is created _only if it is null_.



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