This is an automated email from the ASF dual-hosted git repository.

CritasWang pushed a commit to branch wx/iotdb-2.0.11-alignment
in repository https://gitbox.apache.org/repos/asf/iotdb-extras.git

commit 5bc6d2be891007c14badbb2ed9c32e28cc91ecb7
Author: CritasWang <[email protected]>
AuthorDate: Thu Sep 17 17:50:47 2026 +0800

    ci: make the MyBatis integration job reach the IoTDB service
    
    The service container only listened on its loopback because the image
    defaults dn_rpc_address to 127.0.0.1, so the published port accepted the
    TCP handshake and the JDBC session was reset. Bind it to all interfaces,
    as the Testcontainers ITs already do, and replace the TCP probe with a
    real client round trip through start-cli: the port is reachable several
    seconds before the DataNode can open a session.
---
 .github/workflows/compile-check.yml | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/compile-check.yml 
b/.github/workflows/compile-check.yml
index b72650b..71ca659 100644
--- a/.github/workflows/compile-check.yml
+++ b/.github/workflows/compile-check.yml
@@ -67,6 +67,9 @@ jobs:
         image: apache/iotdb:2.0.11-standalone
         env:
           MEMORY_SIZE: 1G
+          # The image binds the client RPC service to 127.0.0.1 by default, 
which the
+          # published port cannot reach; bind to all interfaces like the 
Testcontainers ITs do.
+          dn_rpc_address: 0.0.0.0
         ports:
           - 6667:6667
     steps:
@@ -76,19 +79,21 @@ jobs:
           distribution: liberica
           java-version: 17
           cache: maven
-      - name: Wait for IoTDB RPC
+      - name: Wait for IoTDB to accept client sessions
+        # A TCP probe passes as soon as the port is published, several seconds 
before the
+        # DataNode can open a session, so wait for a real client round trip 
instead.
         run: |
-          python3 - <<'PY'
-          import socket, time
-          for attempt in range(120):
-              try:
-                  with socket.create_connection(('127.0.0.1', 6667), 
timeout=1):
-                      break
-              except OSError:
-                  time.sleep(1)
-          else:
-              raise SystemExit('IoTDB RPC did not become ready')
-          PY
+          for attempt in $(seq 1 120); do
+            if docker exec "${{ job.services.iotdb.id }}" timeout 15 
/iotdb/sbin/start-cli.sh \
+                -h 127.0.0.1 -p 6667 -u root -pw root -e 'SHOW VERSION' 
>/dev/null 2>&1; then
+              echo "IoTDB accepted a client session after ${attempt} 
attempt(s)"
+              exit 0
+            fi
+            sleep 2
+          done
+          echo 'IoTDB did not accept a client session within 4 minutes' >&2
+          docker logs "${{ job.services.iotdb.id }}" 2>&1 | tail -n 100
+          exit 1
       - name: Generate, compile and execute MyBatis mappers
         run: >-
           mvn verify -Pwith-examples,with-springboot,${{ matrix.profiles }}

Reply via email to