This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Adds thread safe access to MGLNetworkConfiguration events dictionary #15113
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@julianrex for posterity, could you please write up what the original issue was and how this fixes it? |
friedbunny
approved these changes
Jul 15, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and we should merge this, but I remain confused about why this metrics work isn’t conditional based on whether or not there’s a delegate to consume it. If that had been the case in the initial implementation, this would never have crashed production end-users.
julianrex
force-pushed
the
jrex/14982-start-download-event
branch
from
July 15, 2019 18:46
1bff49b
to
228e402
Compare
@friedbunny mind taking a another quick look? The delegate method is now called on the main queue, which is wasn't before hand. |
friedbunny
approved these changes
Jul 16, 2019
chloekraw
added
needs backport
Indicates PR needs to be cherrypicked into a previous release branch.
crash
labels
Jul 18, 2019
julianrex
pushed a commit
that referenced
this pull request
Jul 24, 2019
…iguration events dictionary (#15202)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
crash
iOS
Mapbox Maps SDK for iOS
needs backport
Indicates PR needs to be cherrypicked into a previous release branch.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14982, and replaces #15029 in @fabian-guerra's absence.
EDIT: #14982 is a crash in
-[MGLNetworkConfiguration startDownloadEvent:type:]
caused becauseNSMutableDictionary
is not thread-safe and we have concurrent read/writes. This PR uses a concurrent dispatch queue (to allow concurrent reads) but withdispatch_barrier_async
to ensure that writes/deletes are synchronous.Using GCD is a common solution, though we will need to monitor performance.
/cc @chloekraw