Skip to content

feat(aviator): bounded and server-guided flow control for DAST audit and correlation streams (27.1) - #1173

Merged
ankit2995 merged 5 commits into
fortify:feat/v3.x/aviator/27.1from
ankit2995:ankit/stream-flow-control-27.1
Nov 25, 2026
Merged

ankit2995 merged 5 commits into
fortify:feat/v3.x/aviator/27.1from
ankit2995:ankit/stream-flow-control-27.1

Conversation

@ankit2995

@ankit2995 ankit2995 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The DAST audit and SAST-DAST correlation clients now follow the server's flow-control signals, with robustness fixes for long-running streams.

The bound on in-flight requests (#1146) and the stream initialization timeout (#1145) are no longer part of this PR. feat/v3.x/aviator/27.1 now contains both from the dev/v3.x back-merge, and this branch is merged with it (dee221d).

  • Follow server flow control (517336b) in the DAST audit and correlation clients:

    Proto mirrors of the new optional fields (dast_audit.proto, correlation.proto, issue.proto).
    RequestSendWindow.recommend(): the client applies the server's recommended_window, capped at the initial window of 10.
    The init request sets supports_flow_control=true.
    On SERVER_BUSY at stream start, the client retries after retry_after_ms (ServerBusyBackoff, at most MAX_BUSY_STREAM_START_RETRIES = 60). A positive server hint is used as sent; only the client's own backoff is capped.
    Each stream attempt gets its own StreamInitializationTimeout, so a stream re-opened after SERVER_BUSY does not inherit the first attempt's countdown.
    CorrelationStreamProcessor ignores responses from a stale stream after a retry. close() cancels a pending busy-start retry, so no new stream opens after close.

  • Robustness (9c09027, 59a1e92):

    Keepalive pings use scheduleWithFixedDelay instead of scheduleAtFixedRate, so the client no longer sends every missed ping at once after the machine sleeps.
    The SAST client now handles APPLICATION_LOCK_LOST / APPLICATION_LOCK_ERROR. It shows a clear warning, returns the results received so far, releases the stream, and half-closes without sending prompts that are still queued (RequestHandler.completeDiscardingPending()), instead of logging "unknown requestId" and waiting.

  • Correlation retries after partial failures (59a1e92):

    If any correlation or validation request fails, the FPR is still uploaded with the confirmed and rejected pairs, but last_correlation is not written, so bulk correlation selects the version again.
    A direct run skips an unchanged artifact only when last_correlation is at or after that artifact's upload date. After a partial run the rerun proceeds and retries only the undecided pairs. If the attribute definition is missing or SSC cannot be read, the previous artifact-only check applies.

Compatibility
Works against current 27.1 servers: the new fields are optional and ignored when absent.
The SAST stream behaviour is unchanged (still at most 10 in flight); aligning SAST with the server's window is a separate follow-up.

…ion streams (backport of fortify#1146 to 27.1)

Cherry-pick of 43607ce onto feat/v3.x/aviator/27.1. Conflict resolution: keep 27.1's FPR model packages (com.fortify.cli.aviator.fpr/dast; the fcli-common-fpr module from fortify#1151 is dev-only) and drop the StreamInitializationTimeout field/test changes that depend on dev-only fortify#1145.
…on streams

Declare supports_flow_control on stream init, follow the server's recommended_window (never above the client's 10), use retry_after_ms for SERVER_BUSY retries, and re-open a stream the server refuses at start with SERVER_BUSY instead of failing. Proto fields are optional, so older servers are unaffected. SAST is unchanged in this commit (it does not declare flow-control support, so the server never refuses its stream at start).
@ankit2995
ankit2995 changed the base branch from dev/v3.x to feat/v3.x/aviator/27.1 November 18, 2026 09:10
@ankit2995 ankit2995 changed the title Ankit/stream flow control 27.1 feat(aviator): bounded and server-guided flow control for DAST audit and correlation streams (27.1) Nov 19, 2026
AnkitRathod29 and others added 2 commits November 23, 2026 21:53
- SAST stream: on APPLICATION_LOCK_LOST/ERROR, complete the result with the
  responses received so far, release the stream latch, stop pings, and
  half-close without flushing queued prompts (new
  RequestHandler.completeDiscardingPending).
- Correlation: leave last_correlation unchanged when any correlation or
  validation request failed, and only treat an unchanged artifact as already
  correlated when last_correlation is not older than its upload date, so
  failed pairs are retried by bulk and direct runs.
- ServerBusyBackoff: honour positive server retry_after_ms hints as sent;
  cap only locally generated delays.
- Correlation: close() cancels a pending busy-start restart and the restart
  checks a closed flag, so no new RPC starts after close.
- Fix log placeholders (%s for String.format-based warn, {} for SLF4J info).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The target branch now contains fortify#1146 itself (back-merged from dev/v3.x),
along with fortify#1145 (StreamInitializationTimeout) and fortify#1151 (FPR classes moved
to com.fortify.cli.common.fpr). Conflicts were resolved by taking the target's
version of each conflicted file and replaying only this branch's changes
made after the fortify#1146 backport (server flow control, keepalive/lock-lost
robustness, review fixes).

Correlation now creates its StreamInitializationTimeout per stream attempt,
as DAST audit already does, so a stream re-opened after SERVER_BUSY gets its
own countdown instead of inheriting the first attempt's. Both processors
close the refused attempt's timer before a busy-start retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ankit2995
ankit2995 requested a review from kireetivar November 23, 2026 16:59
@ankit2995
ankit2995 merged commit 187a38a into fortify:feat/v3.x/aviator/27.1 Nov 25, 2026
15 of 16 checks passed
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.

4 participants