Skip to content

NIFI-15906: Fix IllegalStateException during cluster reconnect in StandardConnection#11212

Open
rakesh-rsky wants to merge 1 commit intoapache:mainfrom
rakesh-rsky:fix/NIFI-15906-cluster-reconnect-ise
Open

NIFI-15906: Fix IllegalStateException during cluster reconnect in StandardConnection#11212
rakesh-rsky wants to merge 1 commit intoapache:mainfrom
rakesh-rsky:fix/NIFI-15906-cluster-reconnect-ise

Conversation

@rakesh-rsky
Copy link
Copy Markdown

Summary

During cluster node reconnection, StandardConnection.setDestination() throws an IllegalStateException ("Cannot change destination while destination is running") when the destination is a RemoteGroupPort. Remote ports are managed by the cluster coordinator and can legally be running during reconnect — they should be exempt from this guard, just like Funnel and NiFiPort.

Changes

  • Added RemoteGroupPort to the instanceof-check exemption list in StandardConnection.setDestination().
  • RemoteGroupPort was already imported in the file; no new imports needed.

Testing

  • Reproducer: disconnect a node from a cluster that has a Remote Process Group destination, then reconnect — the ISE no longer fires.
  • Existing unit tests pass.

Fixes: https://issues.apache.org/jira/browse/NIFI-15906

… connection destination is a running RemoteGroupPort

During cluster reconnect, StandardVersionedComponentSynchronizer calls
updateConnectionDestinations() which temporarily re-points connections to
a dummy Funnel. When the current destination is a RemoteGroupPort (RPG)
that has versionedComponentId=null (common for S2S ports discovered at
runtime), the synchronizer cannot match it to the versioned component map
and attempts a temp-Funnel detour.

StandardConnection.setDestination() previously blocked this with:
  IllegalStateException: Cannot change destination of Connection because
  the current destination ([RemoteGroupPort[...]]) is running

This left the cluster node permanently disconnected after a reconnect
attempt whenever an active RPG ingress port was involved.

- Added RemoteGroupPort to the running-destination exemption list alongside
  Funnel and LocalPort in the setDestination() guard
- RemoteGroupPort is safe to re-route: it does not hold per-FlowFile
  processor execution state, matching the design intent of the existing
  Funnel and LocalPort exemptions
- RemoteGroupPort is already imported in this class (no new imports needed)

Co-authored-by: Rakesh Kumar Singh <rsky.rakesh@gmail.com>
@rakesh-rsky rakesh-rsky force-pushed the fix/NIFI-15906-cluster-reconnect-ise branch from 868dcc7 to e257c96 Compare May 6, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant