File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,32 +93,42 @@ echo "DEBUG: Using cert: $OWNER_CERT_FILE"
9393# Use temporary file to capture curl output and status
9494temp_output=$( mktemp)
9595temp_stderr=$( mktemp)
96+ echo " DEBUG: Created temp files: $temp_output , $temp_stderr "
97+
9698request_pid=" "
9799(
100+ echo " DEBUG: [subprocess] Starting curl request..." >&2
98101 curl -k -f -w " \nHTTP_STATUS:%{http_code}\n" \
99102 -E " $OWNER_CERT_FILE " :" $OWNER_CERT_PWD " \
100103 -H " Accept: application/n-triples" \
101104 " $namespace_doc " > " $temp_output " 2> " $temp_stderr "
105+ curl_result=$?
106+ echo " DEBUG: [subprocess] Curl finished with exit code: $curl_result " >&2
107+ exit $curl_result
102108) &
103109request_pid=$!
110+ echo " DEBUG: Background process PID: $request_pid "
104111
105112# Wait up to 30 seconds for the request to complete
106113timeout_seconds=30
107114elapsed=0
115+ echo " DEBUG: Entering wait loop..."
108116while kill -0 " $request_pid " 2> /dev/null; do
109117 if [ $elapsed -ge $timeout_seconds ]; then
110118 kill -9 " $request_pid " 2> /dev/null || true
111119 echo " ERROR: Request timed out after ${timeout_seconds} seconds - deadlock detected!"
112120 echo " DEBUG: Curl stderr output:"
113- cat " $temp_stderr "
121+ cat " $temp_stderr " || echo " (could not read stderr file) "
114122 rm -f " $temp_output " " $temp_stderr "
115123 exit 1
116124 fi
117125 sleep 1
118126 (( elapsed++ ))
119127done
128+ echo " DEBUG: Exited wait loop after ${elapsed} s"
120129
121130# Check if curl succeeded
131+ echo " DEBUG: Calling wait on PID $request_pid ..."
122132wait " $request_pid "
123133curl_exit_code=$?
124134
You can’t perform that action at this time.
0 commit comments