Skip to content

fix: WR-18424 handle transient orders sdk exceptions - #18

Merged
DustinK-retailsuccess merged 1 commit into
mainfrom
fixes/WR-18424-handle-transient-orders-sdk-exceptions
Jun 9, 2026
Merged

DustinK-retailsuccess merged 1 commit into
mainfrom
fixes/WR-18424-handle-transient-orders-sdk-exceptions

Conversation

@DustinK-retailsuccess

Copy link
Copy Markdown
Contributor

Currently the following exception will result in a message being dead-lettered and not retried. However, this is a failure that should be retried as it's a temporary failure due to the Orders Micro being temporarily inaccessible.

This PR update the logic when interacting with the Orders SDK to be more resilient and inspect the exceptions thrown by the SDK to determine if they are temporary in nature (treat as transient and retry) or if they will continue to fail regardless how many retry attempts occur (DLQ like in a bad request scenario for an invalid Account Number).

{
    "Timestamp": "2026-05-29T22:05:13.9063388+00:00",
    "Level": "Error",
    "MessageTemplate": "Unrecoverable error processing message. Dead-lettering.",
    "Exception": "System.Net.Http.HttpRequestException: Unknown socket error (orders.luci-dev:80)\n ---> System.Net.Sockets.SocketException (0xFFFDFFFE): Unknown socket error\n   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)\n   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)\n   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)\n   --- End of inner exception stack trace ---\n   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)\n   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n   at System.Net.Http.HttpConnectionPool.InjectNewHttp11ConnectionAsync(QueueItem queueItem)\n   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)\n   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)\n   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)\n   at System.Net.Http.SocketsHttpHandler.<SendAsync>g__CreateHandlerAndSendAsync|115_0(HttpRequestMessage request, CancellationToken cancellationToken)\n   at Microsoft.Extensions.Http.Logging.LoggingHttpMessageHandler.<SendCoreAsync>g__Core|4_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)\n   at Microsoft.Extensions.Http.Logging.LoggingScopeHttpMessageHandler.<SendCoreAsync>g__Core|4_0(HttpRequestMessage request, Boolean useAsync, CancellationToken cancellationToken)\n   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)\n   at Refit.RequestBuilderImplementation.<>c__DisplayClass14_0`2.<<BuildCancellableTaskFuncForMethod>b__0>d.MoveNext() in /_/Refit/RequestBuilderImplementation.cs:line 256\n--- End of stack trace from previous location ---\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.Gateways.Propay.PropayStoreOwnerResolver.Resolve(Int64 accountNumber, CancellationToken cancellationToken) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/Gateways/Propay/PropayStoreOwnerResolver.cs:line 14\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.PaymentConfigurationMessageHandler.Handle(SQSMessage message, CancellationToken cancellationToken) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/PaymentConfigurationMessageHandler.cs:line 40\n   at Wayroo.Payments.ConfigurationRecorder.Lambda.Function.FunctionHandler(SQSEvent input, ILambdaContext context) in /home/vsts/work/1/s/Wayroo.Payments.ConfigurationRecorder.Lambda/Wayroo.Payments.ConfigurationRecorder.Lambda/Function.cs:line 54",
    "Properties": {
        "SourceContext": "Wayroo.Payments.ConfigurationRecorder.Lambda.ProcessFailureHandler",
        "MessageId": "6ab71245-bbd5-43bc-a96e-7f86ff653b41",
        "TraceId": "Root=1-6a1a0d97-5a82ae5340232ad56cdad1e1;Parent=5d3aaedccf18ae1a;Sampled=0;Lineage=1:008a1e6d:0",
        "FunctionName": "dev-WayrooPayments-ConfigurationRecorderLambda",
        "AwsRequestId": "ad2f59d3-62cf-5e8a-916d-3b476d01344c",
        "InvokedFunctionArn": "arn:aws:lambda:us-east-1:203538442868:function:dev-WayrooPayments-ConfigurationRecorderLambda",
        "Scope": [
            "6ab71245-bbd5-43bc-a96e-7f86ff653b41",
            "6ab71245-bbd5-43bc-a96e-7f86ff653b41"
        ]
    }
}

@DustinK-retailsuccess
DustinK-retailsuccess merged commit 3d457da into main Jun 9, 2026
7 checks passed
@DustinK-retailsuccess
DustinK-retailsuccess deleted the fixes/WR-18424-handle-transient-orders-sdk-exceptions branch June 9, 2026 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants