-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Deadlock closing app after failed tile request #1477
Comments
This regressed as part of #1065; we are no longer sending an explicit termination message to the Map thread, so we never destruct ~MapContext, never destruct ~Source, never cancel the request. |
|
Ah, I think I see what you mean about an explicit termination message @kkaefer. I think that should be avoidable with the current design though, where destructors get called through the course of shutting down the thread. The problem in this scenario is that MapContext's run loop doesn't exit because there are referenced uv_handles belonging to these objects and this async [edit: just the latter; the other objects are handles on a different run loop]. If I cause these handles to be unref'd, the deadlock is resolved. However then I hit an assertion failure in |
The assertion failure is because, even with unref'd handles, |
Further untangling is running into the known issue that cache requests can outlive their completion callback and also the complexities of the |
@jfirebaugh curious, is #1629 a step towards resolving this or unrelated? |
I thought it would be a step towards resolving this but in the end it's unrelated. |
I think I'm hitting a variation of this at #1588 (comment), this is sorta blocking merging a fix to https://github.com/mapbox/node-mapbox-gl-native/issues/122 now. |
@jfirebaugh do you mind if I take this one? I'm on #1657 which is almost the same thing (if not the same). |
Go for it. I think #1657 is the same. This async handle keeps the map thread event loop alive. |
Fixed by #1657 |
To replicate:
s
until you get to the mapbox-streets style../style/style/mapbox-streets-v7.json
and give a phony url for one of the layers:Seen with
mac osx
and 21c419b. The Activity Monitor callstack looks like: https://gist.github.com/springmeyer/b39debea42daa9f3e472The text was updated successfully, but these errors were encountered: