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

feat: Add start_updater_thread to update off the main thread #11

Merged
merged 3 commits into from
Apr 25, 2023

Conversation

eseidel
Copy link
Contributor

@eseidel eseidel commented Apr 24, 2023

This makes it so that clients can easily not block when wanting to
queue an update.

I have a separate patch which updates the Engine to use this new
API.

I also needed to split the concept of the "next_boot" patch
from the "current_boot" patch, previously refered to as
"current" or "active" patch. This required adding a
report_launch_start api to let the updater library know
when to set current_boot patch from next_boot.

I also removed the rust updater/cli in this as well as the
vmpath argument to init.

I also exposed the report_launch_success api, but its not yet
used by the Engine.

I renamed report_failed_launch to report_launch_failure to match
report_launch_start which I introduced.

eseidel added a commit to shorebirdtech/engine that referenced this pull request Apr 24, 2023
This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.
library/src/c_api.rs Outdated Show resolved Hide resolved
library/src/updater.rs Outdated Show resolved Hide resolved
/// cache. The Engine calls this during boot and it will check for an update
/// and install it if available.
pub fn start_update_thread() {
// This holds the lock on the config for the entire duration of the update
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any harm in holding the lock on the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is, in that any other calls into the library will block until the lock is released. Which means that if we add a dart api those calls would hang while an update is in progress. Better is to have it drop the lock while it's doing network requests since those can go on for a long time.

@eseidel eseidel marked this pull request as ready for review April 25, 2023 15:47
eseidel and others added 3 commits April 25, 2023 09:02
This makes it so that clients can easily not block when wanting to
queue an update.

I have a separate patch which updates the Engine to use this new
API.

I also needed to split the concept of the "next_boot" patch
from the "current_boot" patch, previously refered to as
"current" or "active" patch.  This required adding a
report_launch_start api to let the updater library know
when to set current_boot patch from next_boot.

I also removed the rust updater/cli in this as well as the
vmpath argument to init.

I also exposed the report_launch_success api, but its not yet
used by the Engine.

I renamed report_failed_launch to report_launch_failure to match
report_launch_start which I introduced.
Also added a helper for char* allocation (not sure if it's better).
Remove space

Co-authored-by: Felix Angelov <felix@shorebird.dev>
@eseidel eseidel merged commit 4ab7886 into main Apr 25, 2023
@eseidel eseidel deleted the async_update branch April 25, 2023 16:06
eseidel added a commit to shorebirdtech/engine that referenced this pull request Apr 25, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Apr 26, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request May 11, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request May 11, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 22, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 22, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 22, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 22, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 24, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 24, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 26, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 26, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 30, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 30, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 30, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 30, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request May 30, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 6, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 6, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 6, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Jun 8, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Jun 8, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 8, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 8, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 16, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jun 16, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Jun 22, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Jun 22, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
@l00ai l00ai mentioned this pull request Jul 2, 2023
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jul 13, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Jul 13, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Aug 18, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Aug 18, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Aug 24, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Aug 24, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Sep 8, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Sep 8, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Sep 19, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Sep 19, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Sep 21, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Sep 21, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Oct 2, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Oct 2, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Oct 19, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
eseidel added a commit to shorebirdtech/engine that referenced this pull request Oct 19, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Oct 26, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
felangel pushed a commit to shorebirdtech/engine that referenced this pull request Oct 26, 2023
* feat: Support async updates from the updater library.

This is the engine side of:
shorebirdtech/updater#11

I also removed passing vmpath (unused) and adjusted names
to be more consistent.

* Add DEPS change
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.

2 participants