You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "sivakumar-mahalingam (via GitHub)" <gi...@apache.org> on 2026/09/30 19:43:49 UTC
[PR] fix(ams): reject non-positive optimizer parallelism [amoro]
sivakumar-mahalingam opened a new pull request, #4398:
URL: https://github.com/apache/amoro/pull/4398
## Why are the changes needed?
The optimizer creation endpoints accepted zero or negative parallelism and passed it directly to `Resource.Builder#setThreadCount`. This could create an optimizer without executor threads or cause failures later in the optimizer lifecycle.
Invalid parallelism should be rejected at the REST API boundary before any optimizer resource is requested or persisted.
Close #4395
## Brief change log
- Validate that `parallelism` is greater than zero in:
- `OptimizerController#createOptimizer`
- `OptimizerGroupController#scaleOutOptimizer`
- Return a Javalin `BadRequestResponse` with HTTP status 400 for invalid parallelism.
- Add parameterized unit tests covering parallelism values `0` and `-1` for both endpoints.
- Verify that `OptimizerManager` is not invoked for invalid requests.
## How was this patch tested?
- [x] Added unit tests covering zero and negative parallelism for both optimizer creation paths.
- [ ] Add screenshots for manual tests if appropriate — not applicable.
- [x] Ran tests locally before making the pull request.
```bash
./mvnw test -pl amoro-ams -am \
-Dtest=TestOptimizerController,TestOptimizerGroupController \
-Dsurefire.failIfNoSpecifiedTests=false
```
Result: 16 tests passed with no failures or errors.
Formatting and Checkstyle were also verified:
```bash
./mvnw validate -pl amoro-ams -am
```
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(ams): reject non-positive optimizer parallelism [amoro]
Posted by "xxubai (via GitHub)" <gi...@apache.org>.
xxubai merged PR #4398:
URL: https://github.com/apache/amoro/pull/4398
--
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: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org