Skip to content

FIX pace concurrent prompt target retries - #2655

Open
Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-request-rate-pacing
Open

Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-request-rate-pacing

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Concurrent calls to a rate-limited prompt target could serve their delays at the same time, causing requests to start in a burst. Retry decorator ordering also allowed some retry attempts to bypass PyRIT's pacing.

This change:

  • serializes pre-request delays with a per-target, event-loop-aware lock
  • releases the lock before provider work so paced requests can overlap while in flight
  • safely recreates the lock when a target is reused across event loops
  • composes retry and pacing decorators so every PyRIT retry attempt is paced
  • adds coverage for concurrent starts, cancellation safety, retry pacing, and cross-loop reuse

Validation

  • Focused prompt-target tests: 576 passed, 30 skipped
  • Ruff check and format check
  • Changed-file ty check
  • Changed-source compileall
  • git diff --check

Serialize per-target request delays without holding the pacing lock during provider calls, and recreate locks across event loops. Ensure retrying targets pace every attempt.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 21bf73f6-4b26-4f5f-bb22-01fa72e49186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant