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

TryGetDownloadCountForPackageRegistration can throw a modified enumerator exception #5779

Closed
joelverhagen opened this issue Apr 9, 2018 · 3 comments
Assignees

Comments

@joelverhagen
Copy link
Member

This results in an HTTP 500 for the user. This has happened at least 6 times in the last 7 days on PROD.

AI query

requests
| where timestamp > ago(90d)
| where name contains "PushPackageApi"  or name contains "verify" 
| where name startswith "PUT" or name startswith "POST"
| summarize sum(itemCount) by bin(timestamp, 1d), tostring(resultCode)

requests
| where timestamp > ago(7d)
| where name contains "PushPackageApi"  or name contains "verify" 
| where name startswith "PUT" or name startswith "POST"
| where resultCode == 500
| join kind=inner (
   exceptions 
) on $left.operation_Id == $right.operation_Id
| where innermostMessage == "Collection was modified; enumeration operation may not execute."
| project problemId

This is where the exception is being thrown from:

downloadCount = _downloadCounts[id].Sum(kvp => kvp.Value);

Probably need some locking.

@joelverhagen
Copy link
Member Author

FYI this has happened 76 times in the last 90 days.

exceptions
| where timestamp > ago(90d)
| where innermostMessage == "Collection was modified; enumeration operation may not execute."

@joelverhagen
Copy link
Member Author

This is related to the push flow because every time we materialize a PackageRegistration record via EF, we call into CloudDownloadCountService.

joelverhagen added a commit that referenced this issue Apr 20, 2018
Add unit tests to verify casing changes and repro of bug
Use ConcurrentDictionary instead of Dictionary
Address #5779
@joelverhagen joelverhagen added this to the S134 - 2018/04/09 milestone Apr 20, 2018
@joelverhagen
Copy link
Member Author

I've merged the fix to dev branch. It is not validated anywhere except my devbox.

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

No branches or pull requests

3 participants