Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Hubs] Remove minimum timeout value #28970

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdk/eventhub/event-hubs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- The minimum value of timeout for all operations is no longer 60 seconds. The user can now set the timeout to lower values if needed. The default timeout value is still 60 seconds.

## 5.11.3 (2023-11-07)

### Bugs Fixed
Expand Down
4 changes: 2 additions & 2 deletions sdk/eventhub/event-hubs/src/models/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export enum CloseReason {
* - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
* this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
* - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
* retry attempts remaining. Minimum value: 60000 milliseconds.
* retry attempts remaining. Default value: 60000 milliseconds.
*
* A simple usage can be `{ "maxRetries": 4 }`.
*
Expand Down Expand Up @@ -162,7 +162,7 @@ export interface EventHubClientOptions {
* - `retryDelayInMs`: Amount of time to wait in milliseconds before making the next attempt. When `mode` is set to `Exponential`,
* this is used to compute the exponentially increasing delays between retries. Default: 30000 milliseconds.
* - `timeoutInMs`: Amount of time in milliseconds to wait before the operation times out. This will trigger a retry if there are any
* retry attempts remaining. Minimum value: 60000 milliseconds.
* retry attempts remaining. Default value: 60000 milliseconds.
*
* A simple usage can be `{ "maxRetries": 4 }`.
*
Expand Down
4 changes: 1 addition & 3 deletions sdk/eventhub/event-hubs/src/util/retries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { Constants, RetryOptions } from "@azure/core-amqp";
*/
export function getRetryAttemptTimeoutInMs(retryOptions: RetryOptions = {}): number {
const { timeoutInMs } = retryOptions;
return typeof timeoutInMs !== "number" ||
!isFinite(timeoutInMs) ||
timeoutInMs < Constants.defaultOperationTimeoutInMs
return typeof timeoutInMs !== "number" || !isFinite(timeoutInMs)
? Constants.defaultOperationTimeoutInMs
: timeoutInMs;
}