JackieTien97 opened a new pull request, #18939:
URL: https://github.com/apache/iotdb/pull/18939
## Description
Normal DataNode shutdown interrupts query scheduler waits and internal
metric writes. These expected interruptions could produce `[ExecuteFailed]` or
metric-write/timeseries-creation WARN logs. Handle shutdown interruptions
explicitly while preserving task cleanup and warnings for other failures.
### Query scheduler
- Suppress the queue-poll warning only when the driver thread has been
closed.
- Classify direct or wrapped execution interruptions after closure as
scheduler shutdown, with an English/Chinese abort reason.
- Continue calling `scheduler.toAborted()` to release query resources. Keep
warnings for unexpected runtime interruptions and non-interruption failures,
including failures during shutdown.
### Internal metric reporter
- Publish the reporter's stopped state before cancelling work, covering both
node shutdown and reporter reload.
- Skip new or queued writes and follow-up schema creation/retries once
stopping begins; handle the race between task submission and executor shutdown.
- Downgrade failures only with shutdown/interruption evidence, or a
read-only response during node shutdown. A generic `INTERNAL_SERVER_ERROR`
remains a warning without interruption evidence.
- Serialize reporter start/stop and reject restarting an already stopped
executor.
### Validation
- Full English reactor build and 27 targeted unit tests passed (21 new tests
and 6 existing scheduler tests):
```sh
mvn test \
-Dtest=AbstractDriverThreadShutdownTest,IoTDBInternalLocalReporterTest,DriverTaskTimeoutSentinelThreadTest
\
-Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false
```
- Full clean Chinese main/test compilation passed:
```sh
mvn clean test-compile -DskipTests -P with-zh-locale
```
- `mvn spotless:apply -pl iotdb-core/datanode`, `git diff --check`, and
query-message key parity checks passed.
- Tests cover real worker interruption via `shutdownNow()`, polling/sleeping
shutdown, abort cleanup invocation, normal query timeout, reporter submission
races, and retention of warnings for unrelated failures.
- The original HA cluster shutdown scenario has not been rerun.
---
This PR has:
- [x] Been self-reviewed, including concurrent shutdown and task submission.
- [x] Added comments explaining non-obvious shutdown handling.
- [x] Added unit tests for the changed behavior.
- [x] Included Apache license headers in new test files.
##### Key changed/added classes
- `AbstractDriverThread`
- `DriverTaskAbortedException`
- `IoTDBInternalLocalReporter`
- `AbstractDriverThreadShutdownTest`
- `IoTDBInternalLocalReporterTest`
--
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]