Skip to content

Conversation

@kunigami
Copy link
Contributor

@kunigami kunigami commented Feb 4, 2026

Summary:
This diff adds retry logic with exponential backoff for remote function calls in the Velox client, ported from D91729467.

Changes:

  • Add retry logic with exponential backoff for TTransportException and AsyncSocketException errors
  • Automatically reconnect the thrift client after transport failures
  • Configurable via --remote_function_retry_count (default: 3) and --remote_function_retry_max_backoff_sec (default: 8)
  • Extract common retry logic into handleRetryableError() helper to avoid code duplication
  • Fix jitter distribution to use range [0.5, expIntervalSec + 0.5) to ensure meaningful backoff on first retry
  • Add unit tests for retry behavior and gflag defaults

Differential Revision: D92204805

Guilherme Kunigami added 2 commits February 3, 2026 17:45
…ebookincubator#16231)

Summary:

Refactored the remote function client to use dependency injection, enabling proper mocking in tests:

1. Added `IRemoteFunctionClient` abstract interface in ThriftClient.h with `invokeFunction()` method
2. Added `ThriftRemoteFunctionClient` default implementation that wraps the actual thrift client
3. Added `RemoteFunctionClientFactory` type alias for creating clients
4. Added optional `clientFactory` field to `RemoteThriftVectorFunctionMetadata`
5. Modified `RemoteThriftFunction` to use injected factory (with fallback to default)
6. Added `MockRemoteFunctionTest` test fixture demonstrating mock client usage
7. Added 3 new tests using mock clients instead of real thrift server

This allows tests to inject mock clients instead of requiring a real thrift server, making tests faster and more isolated.

Differential Revision: D92213049
Summary:
This diff adds retry logic with exponential backoff for remote function calls in the Velox client, ported from D91729467.

**Changes:**
- Add retry logic with exponential backoff for TTransportException and AsyncSocketException errors
- Automatically reconnect the thrift client after transport failures
- Configurable via `--remote_function_retry_count` (default: 3) and `--remote_function_retry_max_backoff_sec` (default: 8)
- Extract common retry logic into `handleRetryableError()` helper to avoid code duplication
- Fix jitter distribution to use range [0.5, expIntervalSec + 0.5) to ensure meaningful backoff on first retry
- Add unit tests for retry behavior and gflag defaults

Differential Revision: D92204805
@netlify
Copy link

netlify bot commented Feb 4, 2026

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 9e88f35
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/6982a4b7bc3d410008e04a49

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 4, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 4, 2026

@kunigami has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92204805.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant