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

tuhaihe pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git


The following commit(s) were added to refs/heads/main by this push:
     new 2bca7138 CLI: bypass HTTP proxy when probing the local PXF endpoints
2bca7138 is described below

commit 2bca7138100089f891aa2be2d1c8a5e6298a237d
Author: Dianjin Wang <[email protected]>
AuthorDate: Mon Sep 7 17:34:17 2026 +0800

    CLI: bypass HTTP proxy when probing the local PXF endpoints
    
    The pxf script probes the running service with curl over localhost:
    
        until $curl --silent --connect-timeout 1 -I 
"http://localhost:$PXF_PORT"; | grep 'PXF Server'
    
    curl does not bypass proxies for localhost, so when http_proxy is set in
    the environment -- common on hosts that need a proxy to fetch build
    dependencies -- the probe is sent to the proxy, which cannot reach the
    loopback interface of the PXF host and answers 502 Bad Gateway. The grep
    never matches, so `pxf start` retries for all 300 attempts while the
    service is up and healthy, and `pxf status` reports "PXF is down" for
    the same reason. `pxf stop` is affected too: the POST to
    /actuator/shutdown fails silently and it falls back to SIGTERM/SIGKILL
    instead of shutting down gracefully.
    
    All three endpoints are by definition local to the host, so they should
    never be routed through a proxy. Pass --noproxy '*' to each of them.
---
 server/pxf-service/src/scripts/pxf | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/pxf-service/src/scripts/pxf 
b/server/pxf-service/src/scripts/pxf
index 522d1eda..fe010530 100755
--- a/server/pxf-service/src/scripts/pxf
+++ b/server/pxf-service/src/scripts/pxf
@@ -130,7 +130,7 @@ function waitForSpringBoot() {
 
     # wait until spring boot is up:
     echoYellow 'Checking if PXF is up and running...'
-    until $curl --silent --connect-timeout 1 -I "http://localhost:$PXF_PORT"; | 
grep 'PXF Server' > /dev/null; do
+    until $curl "${curl_opts[@]}" --silent --connect-timeout 1 -I 
"http://localhost:$PXF_PORT"; | grep 'PXF Server' > /dev/null; do
         if (( ++attempts == max_attempts )); then
             echoRed 'ERROR: PXF is down - the application is not running'
             return 1
@@ -151,7 +151,7 @@ function waitForSpringBoot() {
 function checkWebapp() {
     waitForSpringBoot "$1" "$2" || return 1
 
-    curlResponse=$($curl -s "http://localhost:${PXF_PORT}/actuator/health";)
+    curlResponse=$($curl "${curl_opts[@]}" -s 
"http://localhost:${PXF_PORT}/actuator/health";)
 
     [[ $curlResponse == {\"status\":\"UP\"* ]] || fail "PXF is inaccessible. 
Check logs ($PXF_LOGDIR) for more information"
     return 0
@@ -187,6 +187,10 @@ function validate_system() {
     if ! curl=$(command -v curl); then
         fail 'curl is not installed, please install'
     fi
+    # PXF's actuator endpoints are always local to this host, so never route 
the
+    # probes through an HTTP proxy. Without this, an http_proxy set in the
+    # environment makes start/status/stop misreport a healthy PXF as down.
+    curl_opts=(--noproxy '*')
 }
 
 function printUsage() {
@@ -435,7 +439,7 @@ function doStop() {
     echoYellow "Stopping PXF [pid=$pid]..."
 
     # first try endpoint (assume it might be disabled)
-    if $curl --max-time 5 --silent -X POST 
"localhost:$PXF_PORT/actuator/shutdown" | grep "Shutting down, bye..." > 
/dev/null; then
+    if $curl "${curl_opts[@]}" --max-time 5 --silent -X POST 
"localhost:$PXF_PORT/actuator/shutdown" | grep "Shutting down, bye..." > 
/dev/null; then
         for i in $(seq 1 $STOP_WAIT_TIME); do
             if isRunning "$pid"; then
                 sleep 1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to