@@ -232,13 +232,9 @@ def wait_for_orchestration_completion(
232232 # For positive timeout, best-effort pre-check and short polling to avoid long server waits
233233 try :
234234 # First check if the orchestration is already completed
235- print (f'[CLIENT DEBUG] Checking current state before waiting for { instance_id } ' )
236235 current_state = self .get_orchestration_state (
237236 instance_id , fetch_payloads = fetch_payloads
238237 )
239- print (
240- f"[CLIENT DEBUG] Current state: { current_state .runtime_status if current_state else 'None' } "
241- )
242238 if current_state and current_state .runtime_status in [
243239 OrchestrationStatus .COMPLETED ,
244240 OrchestrationStatus .FAILED ,
@@ -256,42 +252,28 @@ def wait_for_orchestration_completion(
256252 poll_start = time .time ()
257253 poll_interval = 0.1
258254
259- print (f'[CLIENT DEBUG] Starting polling for up to { poll_timeout } s' )
260255 while time .time () - poll_start < poll_timeout :
261256 current_state = self .get_orchestration_state (
262257 instance_id , fetch_payloads = fetch_payloads
263258 )
264- print (
265- f"[CLIENT DEBUG] Poll state: { current_state .runtime_status if current_state else 'None' } "
266- )
267259
268260 if current_state and current_state .runtime_status in [
269261 OrchestrationStatus .COMPLETED ,
270262 OrchestrationStatus .FAILED ,
271263 OrchestrationStatus .TERMINATED ,
272264 ]:
273- print (
274- f'[CLIENT DEBUG] Found terminal state during polling: { current_state .runtime_status } '
275- )
276265 return current_state
277266
278267 time .sleep (poll_interval )
279268 poll_interval = min (poll_interval * 1.5 , 1.0 ) # Exponential backoff, max 1s
280- print (f'[CLIENT DEBUG] Polling completed, no terminal state found' )
281269 except Exception :
282270 # Ignore pre-check/poll issues (e.g., mocked stubs in unit tests) and fall back
283271 pass
284272
285273 self ._logger .info (f"Waiting up to { timeout } s for instance '{ instance_id } ' to complete." )
286- print (
287- f'[CLIENT DEBUG] About to call WaitForInstanceCompletion for { instance_id } with timeout { grpc_timeout } '
288- )
289274 res : pb .GetInstanceResponse = self ._stub .WaitForInstanceCompletion (
290275 req , timeout = grpc_timeout
291276 )
292- print (
293- f'[CLIENT DEBUG] WaitForInstanceCompletion returned successfully for { instance_id } '
294- )
295277 state = new_orchestration_state (req .instanceId , res )
296278 if not state :
297279 return None
@@ -311,17 +293,10 @@ def wait_for_orchestration_completion(
311293
312294 return state
313295 except grpc .RpcError as rpc_error :
314- print (
315- f'[CLIENT DEBUG] gRPC error in WaitForInstanceCompletion for { instance_id } : { rpc_error .code ()} - { rpc_error .details ()} '
316- )
317296 if rpc_error .code () == grpc .StatusCode .DEADLINE_EXCEEDED : # type: ignore
318- print (
319- f'[CLIENT DEBUG] Deadline exceeded for { instance_id } , converting to TimeoutError'
320- )
321297 # Replace gRPC error with the built-in TimeoutError
322298 raise TimeoutError ('Timed-out waiting for the orchestration to complete' )
323299 else :
324- print (f'[CLIENT DEBUG] Re-raising non-timeout gRPC error for { instance_id } ' )
325300 raise
326301
327302 def raise_orchestration_event (
0 commit comments