Skip to content
This repository was archived by the owner on Aug 29, 2022. It is now read-only.

HttpServiceClientHandler throws after deciding to retry address #16

@PossiblyMax

Description

@PossiblyMax

Just randomly browsing your repo, and this caught my eye and I thought I would raise it as a question.

In the file HttpServiceClientHandler.cs:

if (we.Status == WebExceptionStatus.ProtocolError)
{
    if (errorResponse.StatusCode == HttpStatusCode.NotFound ||
        errorResponse.StatusCode == HttpStatusCode.ServiceUnavailable)
    {
        // This could either mean we requested an endpoint that does not exist in the service API (a user error)
        // or the address that was resolved by fabric client is stale (transient runtime error) in which we should re-resolve.
        resolveAddress = true;
    }

    // On any other HTTP status codes, re-throw the exception to the caller.
    throw;
}

It looks like it wants to retry to resolve the address in the 'if' case, and sets the flag appropriately to do so, but then immediately throws the error back to the client, ignoring the retry. It appears the throw is expected to be in an else, so I thought I might mention it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions