JackieTien97 opened a new pull request, #18813:
URL: https://github.com/apache/iotdb/pull/18813
## Description
`CollectOperator` currently stalls on its current child even when another
child can produce data. Consume whichever child becomes unblocked, retaining
the selected index on the driver thread so `MappingCollectOperator` applies the
correct column mapping. This follows `CollectNode`'s existing allowance to
consume other children while one is blocked.
Cache each child's blocking future and register at most one listener per
pending child future. Reuse the aggregate future within a wait round, and
retarget existing listeners between rounds with a completion recheck to prevent
missed wakeups. Already-ready children need no listener registration or
aggregate-future allocation. Child failures and cancellations are propagated
before consumption.
Track remaining children independently of their indexes, close all remaining
children, and account for intermediate state retained by other children when
estimating memory.
## Validation
Both clean reactor builds passed, including dependencies and all 15 new unit
tests:
```sh
mvn clean test -pl iotdb-core/calc-commons -am \
-Dtest=AnyChildBlockedTest,CollectOperatorTest \
-Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
mvn clean test -pl iotdb-core/calc-commons -am -P with-zh-locale \
-Dtest=AnyChildBlockedTest,CollectOperatorTest \
-Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
```
Coverage includes 2,000 wait rounds with one long-blocked child, 1,000
concurrent-completion rounds, retargeting races and delayed callbacks,
cancellation/failure handling, out-of-order completion and cleanup, column
mapping, and retained-memory estimates. Spotless formatting and `git diff
--check` also passed.
- [x] Self-reviewed, including completion-thread/driver-thread interactions.
- [x] Added unit tests for new behavior and concurrency cases.
- [x] Added Javadocs and comments explaining listener reuse and wakeup races.
--
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]