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

WIP: Handle upload enable change at startup using callbacks #790

Closed

Conversation

mdboom
Copy link
Contributor

@mdboom mdboom commented Mar 30, 2020

(Kotlin-only implementation for now).

This is an alternative to #786. It avoids the weird flow control by having the Rust core be completely in charge of what to do when the upload state changes (and fixes a bug where a deletion ping is sent on first run, since the startup logic for first run can be made slightly different).

However, it is fundamentally broken since it deadlocks. When the callback is called, it does things involving the global Glean singleton, and since the lock on that is already held, it stalls waiting for the lock. There might be ways of rewriting the FFI wrapper to drop the glean lock and then call the callback, but since the callback is a member of the Glean singleton, I couldn't find a way to do it.

@mdboom mdboom requested a review from badboy March 30, 2020 12:44
@auto-assign auto-assign bot requested a review from brizental March 30, 2020 12:46
@mdboom
Copy link
Contributor Author

mdboom commented Mar 30, 2020

Found a much simpler approach in #791.

@mdboom mdboom closed this Mar 30, 2020
@mdboom mdboom deleted the deletion-request-at-init-with-callback branch April 14, 2020 19:09
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

Successfully merging this pull request may close these issues.

1 participant