-
Notifications
You must be signed in to change notification settings - Fork 662
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
Make image downloads and prepare operations asynchronous #724
Conversation
QNetworkAccessManager can only run in the thread that created it, so in order to run network operations in a different thread, URLDownloader will now allocate a new QNetworkAccessManager object when needed.
Also update copyrights where appropriate.
df17d6b
to
30475a3
Compare
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.
I can confirm this unblocks the daemon while download is happening. But when testing it still looks like "Verifying" and "Configuring" stages are blocking somewhere?
I'm doing a naive test: I set launch going in one shell which starts a download, and repeat "multipass list" in another shell to see if it returns quickly. List appears to block until the Verifying and Configuring steps are complete.
@@ -25,6 +25,7 @@ | |||
#include <fmt/format.h> | |||
|
|||
#include <QMap> | |||
#include <QUrl> |
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.
Needed?
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.
Yes, because some other includes that pulled in QUrl
in url_downloader.h
were removed and now an explicit QUrl
include is needed here.
src/daemon/daemon.cpp
Outdated
@@ -550,6 +550,7 @@ mp::Daemon::Daemon(std::unique_ptr<const DaemonConfig> the_config) | |||
get_unique_id(config->data_directory), config->data_directory}, | |||
metrics_opt_in{get_metrics_opt_in(config->data_directory)} | |||
{ | |||
qRegisterMetaType<VirtualMachineDescription>(); |
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.
I think VS will choke on this unless you prefix the Type with its namespace.
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.
Ugh, silly namespace rules for different compilers....fixed it though:)
I'm puzzled by what you're seeing. I too test the "blocking" behavior as you describe, and I just tried it again and the "Verify" and "Configure" steps are unblocked for me with this branch. I'm sure you've already done this, but could you please double confirm that you were running the right version of the daemon? Otherwise, I'm not really sure what is going on since the "Download", "Verify", and "Configure" steps are all running in a new (and the same) thread now. |
Codecov Report
@@ Coverage Diff @@
## master #724 +/- ##
=========================================
+ Coverage 66.83% 66.9% +0.06%
=========================================
Files 174 174
Lines 6100 6118 +18
=========================================
+ Hits 4077 4093 +16
- Misses 2023 2025 +2
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #724 +/- ##
=========================================
+ Coverage 66.83% 66.9% +0.06%
=========================================
Files 174 174
Lines 6100 6118 +18
=========================================
+ Hits 4077 4093 +16
- Misses 2023 2025 +2
Continue to review full report at Codecov.
|
@townsend2010 totally my bad, I was flicking between master and this to see if another bug was introduced by this, and forgot to call make. |
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
bors r+
724: Make image downloads and prepare operations asynchronous r=gerboland a=townsend2010 Co-authored-by: Chris Townsend <[email protected]>
Sweet! Glad that's all it was:) Thanks! |
Build failed |
The bors build failed because the Mac build fails and needs fixing there. I will merge this manually and fix that build elsewhere. |
No description provided.