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

Fixing threading-related hang during initialization in urgent mode #11216

Merged
merged 3 commits into from May 31, 2023

Conversation

samedson
Copy link
Contributor

@samedson samedson commented May 2, 2023

This is a modification of #10958

Paired on with @wowlocal

Rotating the Installation ID when uploading in Urgent Mode is not necessary, so this modifies the previous PR to skip rotating the Installation ID when we have the conditions for deadlock.

One problem with this seems to be the isMainThread check. Dispatch Queues in the background are not guaranteed to run in a background thread, so I believe the isMainThread check is true even when run on a background dispatch_queue. This seems to over-count cases where this could deadlock.

@google-oss-bot
Copy link

google-oss-bot commented May 2, 2023

Size Report 1

Affected Products

  • FirebaseCrashlytics

    TypeBase (9143c4b)Merge (9295686)Diff
    CocoaPods?-51.5 kB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/UZLCoX8RaK.html

@wowlocal
Copy link
Contributor

wowlocal commented May 6, 2023

I resolved the problem that led to the SPM test failure. #10958 (comment)

@samedson samedson force-pushed the samedson/wowlocal-urgent-deadlock branch 3 times, most recently from 06e64b6 to dcf324c Compare May 31, 2023 18:49
@samedson samedson force-pushed the samedson/wowlocal-urgent-deadlock branch from dcf324c to bf0b680 Compare May 31, 2023 18:50
@firebase firebase deleted a comment from google-oss-bot May 31, 2023
@samedson
Copy link
Contributor Author

@wowlocal this should be a good way to solve the problem.

Thank you very much for your contribution! I was able to use that unit test to reproduce the issue. After removing the fix the test fails, and now it passes.

Going to merge this once my teammate approves.

@samedson samedson requested a review from themiswang May 31, 2023 18:53
Copy link
Contributor

@themiswang themiswang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for simplified the logic!

@wowlocal
Copy link
Contributor

Great fix! I'm glad the test was helpful 😃

@samedson samedson merged commit 68b39b8 into master May 31, 2023
34 checks passed
@samedson samedson deleted the samedson/wowlocal-urgent-deadlock branch May 31, 2023 20:50
@firebase firebase locked and limited conversation to collaborators Jul 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants