[
https://issues.apache.org/jira/browse/NIFI-7590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148930#comment-17148930
]
ASF subversion and git services commented on NIFI-7590:
-------------------------------------------------------
Commit 197df577ac9ade19dd1c2c807231212757bbd3d7 in nifi's branch
refs/heads/master from Tamas Palfy
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=197df57 ]
NIFI-7590 In 'CassandraSessionProvider.onDisabled' setting Cassandra-related
references properly to null after closing them so that they can be renewed in
'onEnabled' (which creates them only if set to 'null', leaving them closed
otherwise).
NIFI-7590 Removed 'CassandraSessionProvider.onStopped'.
This closes #4373.
Signed-off-by: Peter Turcsanyi <[email protected]>
> 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
> Priority: Major
>
> 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)