Skip to content

Commit 035b73c

Browse files
adamtheturtleclaude
andcommitted
Fix wait_for_target_processed returning before status is stable.
Add a confirmation check after target transitions from PROCESSING to guard against eventual consistency issues where other endpoints still see the target as processing. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 717464c commit 035b73c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/vws/vws.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,15 @@ def wait_for_target_processed(
343343
while True:
344344
report = self.get_target_summary_report(target_id=target_id)
345345
if report.status != TargetStatuses.PROCESSING:
346-
return
346+
# Wait and verify once more to guard against the target
347+
# still being seen as processing by other endpoints due
348+
# to eventual consistency.
349+
time.sleep(seconds_between_requests)
350+
report = self.get_target_summary_report(
351+
target_id=target_id,
352+
)
353+
if report.status != TargetStatuses.PROCESSING:
354+
return
347355

348356
elapsed_time = time.monotonic() - start_time
349357
if elapsed_time > timeout_seconds: # pragma: no cover

0 commit comments

Comments
 (0)