[
https://issues.apache.org/jira/browse/NIFI-7590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Peter Turcsanyi reassigned NIFI-7590:
-------------------------------------
Assignee: Tamas Palfy
> CassandraSessionProvider breaks after disable + re-enable
> ---------------------------------------------------------
>
> Key: NIFI-7590
> URL: https://issues.apache.org/jira/browse/NIFI-7590
> Project: Apache NiFi
> Issue Type: Improvement
> 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)