-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CreateItem will only retry for auto-extracted partition key in-case o…
…f container re-creation (#1070) * Fixed bug where if a user provided the wrong partition key value the request would be sent twice. The retry logic for the partition key extraction was always being used if it was a user provided partition key value or an extracted partition key value. The retry logic should only be used for SDK extracted partition key value in scenarios where the cache is stale.
- Loading branch information
Showing
5 changed files
with
102 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...oft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/RequestHandlerHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
//------------------------------------------------------------ | ||
|
||
namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests | ||
{ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
public class RequestHandlerHelper : RequestHandler | ||
{ | ||
public Action<RequestMessage> UpdateRequestMessage = null; | ||
|
||
public override Task<ResponseMessage> SendAsync(RequestMessage request, CancellationToken cancellationToken) | ||
{ | ||
this.UpdateRequestMessage?.Invoke(request); | ||
|
||
return base.SendAsync(request, cancellationToken); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters