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

[Bug] Crash in MSAL telemetry API #3024

Closed
2 tasks done
bgavrilMS opened this issue Nov 18, 2021 · 0 comments · Fixed by #3041
Closed
2 tasks done

[Bug] Crash in MSAL telemetry API #3024

bgavrilMS opened this issue Nov 18, 2021 · 0 comments · Fixed by #3041

Comments

@bgavrilMS
Copy link
Member

bgavrilMS commented Nov 18, 2021

MSAL 4.37.0

Stack trace below. Probably a bug related to the ApiEvent collection, which is not thread safe.

Please consider refactoring telemetry, as the current infrastructure is very complex for our needs (i.e. deprecate WithTemelemetry and all references to MATS).

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at <redacted>
at System.Collections.Generic.Dictionary2.Enumerator.MoveNext()
at Microsoft.Identity.Client.Internal.Requests.RequestBase.InitializeApiEvent(String accountId)
at Microsoft.Identity.Client.Internal.Requests.RequestBase.RunAsync(CancellationToken cancellationToken)
at Microsoft.Identity.Client.ApiConfig.Executors.ConfidentialClientExecutor.ExecuteAsync(AcquireTokenCommonParameters commonParameters, AcquireTokenForClientParameters clientParameters, CancellationToken cancellationToken)
at <redacted>
--- End of inner exception stack trace ---
at <redacted>
at <redacted>
<redacted>
 ---> System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at Microsoft.Identity.Client.ApiConfig.Parameters.AcquireTokenCommonParameters.AddApiTelemetryFeature(ApiTelemetryFeature feature)
at Microsoft.Identity.Client.AbstractAcquireTokenParameterBuilder1.WithAuthority(String authorityUri, Boolean validateAuthority)
at <redacted>

To-do:

  • Fix the bug
  • Update dev app with repro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants