Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.2.0 (2023-08-03)

### Bugs Fixed

- Allow some `HttpStatusCode.NotFound` occurrences in `PostLedgerEntryOperation` to account for unexpected loss of session stickiness. These errors may occur when the connected node changes and transactions have not been fully replicated.

## 1.2.0-beta.1 (Unreleased)

### Features Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/confidentialledger/Azure.Security.ConfidentialLedger",
"Tag": "net/confidentialledger/Azure.Security.ConfidentialLedger_48488df791"
"Tag": "net/confidentialledger/Azure.Security.ConfidentialLedger_5657482b45"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Description>Client SDK for the Azure Confidential Ledger service</Description>
<AssemblyTitle>Azure Confidential Ledger</AssemblyTitle>
<Version>1.2.0-beta.1</Version>
<Version>1.2.0</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>1.1.0</ApiCompatVersion>
<PackageTags>Azure ConfidentialLedger</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,36 @@ public override Response UpdateStatus(CancellationToken cancellationToken = defa

async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, CancellationToken cancellationToken)
{
var statusResponse = async
? await _client.GetTransactionStatusAsync(
Id,
new RequestContext { CancellationToken = cancellationToken, ErrorOptions = ErrorOptions.NoThrow })
.ConfigureAwait(false)
: _client.GetTransactionStatus(Id, new RequestContext { CancellationToken = cancellationToken, ErrorOptions = ErrorOptions.NoThrow });
int retryCount = 0;
Azure.Response statusResponse = null;
while (retryCount < 3)
{
statusResponse = async
? await _client.GetTransactionStatusAsync(
Id,
new RequestContext { CancellationToken = cancellationToken, ErrorOptions = ErrorOptions.NoThrow })
.ConfigureAwait(false)
: _client.GetTransactionStatus(Id, new RequestContext { CancellationToken = cancellationToken, ErrorOptions = ErrorOptions.NoThrow });

// The transaction may not be found due to unexpected loss of session stickiness.
// This may occur when the connected node changes and transactions have not been fully replicated.
// We will perform retry logic to ensure that we have waited for the transactions to fully replicate before throwing an error.
if (statusResponse.Status == (int)HttpStatusCode.NotFound)
{
++retryCount;
}
else
{
break;
}

// Add a 0.5 second delay between retries.
if (async) {
await Task.Delay(500).ConfigureAwait(false);
} else {
Thread.Sleep(500);
}
}

if (statusResponse.Status != (int)HttpStatusCode.OK)
{
Expand All @@ -76,6 +100,7 @@ async ValueTask<OperationState> IOperation.UpdateStateAsync(bool async, Cancella
{
return OperationState.Success(statusResponse);
}

return OperationState.Pending(statusResponse);
}

Expand Down