Fix DataNode restart readiness race in IoTDBConnectionsIT#18192
Merged
jt2594838 merged 1 commit intoJul 13, 2026
Conversation
jt2594838
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Root cause
testClosedDataNodeGetConnectionscurrently finishes its restart wait onceSHOW DATANODESno longer reports anUnknownnode. That condition reflects heartbeat readiness, but it does not guarantee that the restarted DataNode's client RPC service is accepting connections.In the failing Windows run, the restarted DataNode's internal RPC service was ready at
12:06:09.457, while its client RPC service did not start until12:06:10.945. Subsequent test methods entered that gap and failed with a connection error or inconsistent multi-node results.A fixed five-second delay added in #17290 previously masked this gap. It was removed by #17423 after Windows metric binding became asynchronous, exposing this separate lifecycle race.
Fix
Cache the stopped DataNode wrapper and, after the existing ConfigNode status check, poll a direct table-dialect JDBC connection to that specific DataNode. The probe uses a write-only test connection so it creates only one physical session and cannot interfere with the connection-count assertions.
The one-second polling interval returns as soon as ClientRPC is ready, while the bounded 30-second timeout remains robust on slower CI workers. This verifies the actual client RPC and login path needed by the following tests instead of relying on another fixed sleep.
Testing
IoTDBConnectionsITwithTableClusterIT: 4 tests, 0 failures, 0 errorsThis PR has:
Key changed/added classes (or packages if there are too many classes) in this PR
IoTDBConnectionsIT