Skip to content

[FLINK-39225][model] Add retry with default value fallback for Triton inference failures#27759

Open
wrmxs227 wants to merge 2 commits intoapache:masterfrom
wrmxs227:FLINK-39225-triton-retry-fallback
Open

[FLINK-39225][model] Add retry with default value fallback for Triton inference failures#27759
wrmxs227 wants to merge 2 commits intoapache:masterfrom
wrmxs227:FLINK-39225-triton-retry-fallback

Conversation

@wrmxs227
Copy link

What is the purpose of the change

This pull request implements retry mechanism with exponential backoff and default value fallback for Triton model inference failures, enabling robust error handling and
downstream routing of failed records.

Brief change log

- `TritonOptions`: Added `max-retries` (default: 0), `retry-backoff` (default: 100ms), and `default-value` configuration options
- `AbstractTritonModelFunction`: Added fields and getters for the three new retry configuration options
- `TritonInferenceModelFunction`: Implemented exponential backoff retry logic; retries on network errors and 5xx errors (503, 504); fails immediately on 4xx client errors;     

returns configured default value after exhausting all retries
- TritonModelProviderFactory: Registered the three new options in optionalOptions()

Verifying this change

This change added tests and can be verified as follows:

- Added `TritonInferenceRetryTest` with 4 test cases using MockWebServer:
  - Retry succeeds before exhausting max attempts (1 fail + 1 success)
  - Default value returned after all retries fail
  - Exception thrown when no default value is configured and all retries fail
  - 4xx client errors are not retried and fail immediately
- Updated `TritonModelProviderFactoryTest` to include the 3 new configuration options

Does this pull request potentially affect one of the following parts:

- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): yes (retry logic adds latency on failure paths only)
- Anything that affects deployment or recovery: no
- The S3 file system connector: no

Documentation

- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? not documented (configuration options added to `TritonOptions` with JavaDoc)

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 12, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@wrmxs227
Copy link
Author

@flinkbot run azure

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.

3 participants