Skip to content

NIFI-16365 Add automatic Processor scheduling - #11730

Open
markap14 wants to merge 4 commits into
apache:mainfrom
markap14:auto-scheduling
Open

markap14 wants to merge 4 commits into
apache:mainfrom
markap14:auto-scheduling

Conversation

@markap14

@markap14 markap14 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

NIFI-16365

Implements the Automatic (Experimental) Processor scheduling strategy described in NIP-26.

Automatic scheduling starts with one concurrent task and adjusts the count one task at a time. It compares completed work before keeping a change and also considers waiting work, task use, back pressure, Processor yields and failures, CPU load, garbage collection pauses, and the instance-wide concurrent task limit.

For queue-consuming Processors that do not support session batching, a worker can retain its global permit for a bounded 10 millisecond burst of independent invocations. Each invocation retains normal Process Session and commit behavior. The next invocation performs the authoritative input and backpressure readiness check, avoiding duplicate connection scans, and the burst ends on no activity, elapsed time, scheduling changes, interruption, or retirement. Source and trigger-when-empty Processors are excluded.

The change also adds queue wake-up notifications, invocation and commit measurements, automatic scheduling details in diagnostics, user interface support, versioned flow handling, and system tests for supported and fallback Java versions.

Tracking

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number
  • Pull Request commit message starts with Apache NiFi Jira issue number
  • Pull request contains signed commits

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

  • Framework core suite passed: 854 tests, 0 failures, 0 errors, 3 skipped
  • Focused VirtualThreadSchedulingAgentTest suite passed: 39 tests
  • Automatic scheduling system tests passed
  • Relevant packaging modules built successfully
  • Runtime Server image built for linux/amd64 and validated under sustained CDC flow
  • Checkstyle and PMD passed

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • No new dependencies added

Documentation

  • Instance properties documented in the Administration Guide

markap14 and others added 4 commits September 28, 2026 15:25
Co-authored-by: Cursor <cursoragent@cursor.com>
When the global concurrent task limit is fully used, a Processor with a large
backlog could stay at one task while Processors with nearly empty queues held
the permits. One concurrent task now moves at a time from such a donor to the
receiver: the donor gives up the task before the receiver may test it, and the
receiver keeps it only if its throughput increases.

Generated with [Snowflake CoCo](https://docs.snowflake.com/en/user-guide/cortex-code/cortex-code)

Co-authored-by: Snowflake CoCo <noreply@snowflake.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Restored the no-op StandardNiFiServiceFacade.verifyComponentTypes so that flows with missing Processor types can be imported and pasted as ghost Processors
- Removed AUTO scheduling checks from the flow synchronizer and flow snippet so that loading a flow on startup or cluster join never fails because of an unsupported scheduling strategy; validation marks such Processors invalid
- Added the AUTO scheduling check to StandardProcessorDAO.verifyCreate, alongside the existing check in verifyUpdate
- Removed AutoSchedulingIT.testContinuousFlowAdaptsToBlockingWork, which depended on the host having spare CPU

Co-authored-by: Cursor <cursoragent@cursor.com>
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