Caideyipi opened a new pull request, #18192:
URL: https://github.com/apache/iotdb/pull/18192

   ## Description
   
   ### Root cause
   
   `testClosedDataNodeGetConnections` currently finishes its restart wait once 
`SHOW DATANODES` no longer reports an `Unknown` node. 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 until 
`12: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
   
   - `IoTDBConnectionsIT` with `TableClusterIT`: 4 tests, 0 failures, 0 errors
   - Integration-test Checkstyle and Spotless checks passed
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added comments explaining the reason for the readiness probe.
   - [x] updated integration-test coverage for the DataNode restart path.
   - [x] been tested in a test IoTDB cluster.
   
   <hr>
   
   ##### Key changed/added classes (or packages if there are too many classes) 
in this PR
   
   - `IoTDBConnectionsIT`


-- 
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]

Reply via email to