spuru9 opened a new pull request, #1203:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1203
## What is the purpose of the change
`kubernetes.operator.reconcile.parallelism` is documented as "-1 for
unbounded", and `FlinkOperator` honors it. But `FlinkResourceContextFactory`
reuses the same value in `Executors.newFixedThreadPool` without handling `-1`;
`newFixedThreadPool` rejects a negative size, and since the factory is built in
the `FlinkOperator` constructor, `main()` throws before `run()` — the operator
never starts. Following the documented value crashes the operator at startup.
## Brief change log
- In the `FlinkResourceContextFactory` constructor, mirror
`FlinkOperator`'s handling: `newCachedThreadPool` for `-1`,
`newFixedThreadPool(parallelism, ...)` otherwise. The positive-value path is
unchanged.
## Verifying this change
This change added tests and can be verified as follows:
- `FlinkResourceContextFactoryTest`: constructing the factory with
`reconcile.parallelism = -1` must not throw — red before the fix
(`IllegalArgumentException`), green after; a positive value also constructs.
- Manually verified on the released 1.15.0 image
(`ghcr.io/apache/flink-kubernetes-operator`): with `reconcile.parallelism: -1`
the operator throws `IllegalArgumentException` in `FlinkResourceContextFactory`
and the pod never becomes Ready; with the fix, the identical config starts and
reaches 1/1 Ready.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changes to the `CustomResourceDescriptors`:
no
- Core observer or reconciler logic that is regularly executed: no
(operator startup / context-factory construction)
## Documentation
- Does this pull request introduce a new feature? no
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (Claude Code)
Generated-by: Claude Code (Claude Opus 4.8)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]