Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Fix deadlock in http request on hitting tile limit #13858

Merged
merged 1 commit into from
Feb 12, 2019

Conversation

ivovandongen
Copy link
Contributor

Fixes #13669

When hitting the tile limit for offline downloads the filesource thread deadlocks. The callback of the http requests triggers the clearing of all outstanding http request (including the one hitting the limit) and then a lock is requested for a second time in the cancel method called from the http request destructor.

In this case, cancel should not request a lock again, but just set the native pointer to 0.

@ivovandongen ivovandongen added the Android Mapbox Maps SDK for Android label Feb 1, 2019
@ivovandongen ivovandongen force-pushed the ivd_fix_offline_deadlock branch 2 times, most recently from a21dc7f to 4a97ba5 Compare February 12, 2019 10:12
Copy link
Contributor

@pozdnyakov pozdnyakov left a comment

Choose a reason for hiding this comment

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

LGTM % nit

runnable->iter = std::move(iter);
}
std::lock_guard<std::mutex> lock(mutex);
runnables.push_back(runnable);

wake();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: looks wake() does not need locked mutex

@LukasPaczos LukasPaczos added this to the release-kombucha milestone Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants