Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] - tracingPolicy only invoked once on retries #18125

Closed
maorleger opened this issue Oct 11, 2021 · 1 comment · Fixed by #19078
Closed

[core] - tracingPolicy only invoked once on retries #18125

maorleger opened this issue Oct 11, 2021 · 1 comment · Fixed by #19078
Assignees
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.

Comments

@maorleger
Copy link
Member

Tested this on both core V1 and core V2 - it looks like tracingPolicy is only run once regardless of number of retries.

To reproduce (using Key Vault as an example):

async function main(): Promise<void> {
  const provider = new NodeTracerProvider();
  provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
  provider.register();

  const tracer = provider.getTracer("my-service");

  const keyClient = new KeyClient("<KEYVAULT_NAME>", new AzureCliCredential(), {
    retryOptions: {
      maxRetries: 2,
    },
  });
  await tracer.startActiveSpan("root", async (span) => {
    await keyClient.createEcKey("retry");
  });
}

Then modify exponentialRetryPolicy to always retry up to the retryCount (easier than setting up the retry conditions).

Expected:

  • 3 spans should be created, one for original try and 2 for 2 retries

Actual:

  • Only one span is created

Note: haven't had a chance to dig into the root cause yet - would we just need to reorder policies in coreHttp and coreClient?

@maorleger maorleger added Client This issue points to a problem in the data-plane of the library. Azure.Core labels Oct 11, 2021
@maorleger maorleger added this to the Backlog milestone Oct 11, 2021
@maorleger maorleger self-assigned this Oct 11, 2021
@maorleger
Copy link
Member Author

This might get fixed by #19078 thanks to @sadasant 😄

This is fine to parent against Azure Core Fundamentals for JS IMO - it won't block core-tracing GA

@sadasant sadasant self-assigned this Dec 14, 2021
@sadasant sadasant modified the milestones: Backlog, [2022] January Dec 14, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants