Skip to content

Commit fbc2701

Browse files
Quick bug fix: PPAF (Azure#35192)
### Packages impacted by this PR ### Issues associated with this PR ### Describe the problem that is addressed by this PR ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
1 parent b2ff1e3 commit fbc2701

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdk/cosmosdb/cosmos/src/request/RequestHandler.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async function httpRequest(
5757
}
5858
}
5959

60+
let requestTimeout = requestContext.connectionPolicy.requestTimeout;
6061
// If the request is a read request and partition level failover or circuit breaker is enabled,
6162
// set a shorter timeout to allow for quicker failover in case of partition unavailability.
6263
// This is to ensure that read requests can quickly failover to another partition if the current one is unavailable.
@@ -67,14 +68,14 @@ async function httpRequest(
6768
requestContext.resourceType === ResourceType.item &&
6869
isReadRequest(requestContext.operationType)
6970
) {
70-
requestContext.connectionPolicy.requestTimeout = Math.min(
71+
requestTimeout = Math.min(
7172
requestContext.connectionPolicy.requestTimeout,
7273
Constants.RequestTimeoutForReadsInMs,
7374
);
7475
}
7576
const timeout = setTimeout(() => {
7677
controller.abort();
77-
}, requestContext.connectionPolicy.requestTimeout);
78+
}, requestTimeout);
7879

7980
let response: PipelineResponse;
8081

0 commit comments

Comments
 (0)