Skip to content

Conversation

mcgilman
Copy link
Contributor

Summary

This PR adds support for exposing the physical state of processors in the NiFi API, enabling the UI to allow stopping processors that are in the STARTING physical state.

Problem Statement

Previously, when a processor was starting up (executing @OnScheduled methods), its logical state was STOPPED but the physical state was STARTING. The UI had no visibility into this physical state. Users couldn't stop processors that were stuck in the STARTING state, requiring process group-level stops as a workaround

Solution Overview

Added physicalState field to processor DTOs and entities, with full support for:

  • API exposure with proper schema documentation
  • Cluster response merging with transition state prioritization
  • Backend validation allowing stops of STARTING processors
  • Frontend updates to allow the user to stop a STARTING processor

@mcgilman mcgilman added the ui Pull requests for work relating to the user interface label Sep 25, 2025
Copy link
Contributor

@rfellows rfellows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI changes look good 👍

@mcgilman mcgilman added the hacktoberfest-accepted Hacktoberfest Accepted label Oct 1, 2025
Copy link
Contributor

@sfc-gh-mpayne sfc-gh-mpayne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mcgilman the backend changes look good for the most part. Only real concern that I have is around handling NullPointerException explicitly

Comment on lines 571 to 572
} catch (NullPointerException npe) {
throw new NiFiCoreException("Unable to stop starting processor.", npe);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be catching NullPointers

} catch (NullPointerException npe) {
throw new NiFiCoreException("Unable to stop starting processor.", npe);
} catch (Exception e) {
throw new NiFiCoreException("Unable to stop starting processor: " + e, e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Exception in this case should probably include the toString() of the Processor in question.

@markap14 markap14 merged commit 739fea6 into apache:main Oct 2, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Hacktoberfest Accepted ui Pull requests for work relating to the user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants