You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/06/30 19:59:00 UTC
[jira] [Commented] (NIFI-7590) CassandraSessionProvider breaks
after disable + re-enable
[ https://issues.apache.org/jira/browse/NIFI-7590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17148931#comment-17148931 ]
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 <tu...@apache.org>
> 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)