Bug 3248

Summary: It should be possible to cancel the network configuration test while in progress
Product: [Build System, Metadata & Runtime] Hob Reporter: Belen Barros Pena <belen.barros.pena>
Component: hobAssignee: Cristian Iorga <cristian.iorga>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: Low CC: cristian.iorga, cristiana.voicu, jessica.zhang, poky.bs.watcher, poky.watcher, valentin.popa
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard: in development
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Testing network configuration.pdf none

Description Belen Barros Pena 2012-10-08 11:15:12 UTC
Created attachment 878 [details]
Testing network configuration.pdf

In Hob, the Network tab in the Settings dialog provides a 'Test network configuration' button. When I click that button, Hob checks if my computer has connectivity and shows me a progress bar as it does so. However, it is currently not possible to stop the network check while in progress. We should add a 'Cancel' option as shown in the attached document 'Testing network configuration.pdf'.
Comment 1 Cristian Iorga 2012-10-15 11:49:32 UTC
Part of HOB improvement sprint for 1.4
Comment 2 Cristian Iorga 2012-10-17 14:28:12 UTC
Investigation started.
Comment 3 Cristian Iorga 2012-10-26 09:27:34 UTC
In development.
Comment 4 Cristian Iorga 2012-10-26 10:03:40 UTC
This enhacement requires changes in bitbake also, so the implementation needs to be well thought out, so it does not impact bitbake functionality.
Comment 5 Cristian Iorga 2012-10-26 10:29:03 UTC
Having the posibility of canceling the network tests in Hob means that the check_connectivity(sanity_data) call from meta/classes/sanity.bbclass needs to be executed asynchronously, as now is executed synchronously, and, as such its execution cannot be stopped during the network test.
Comment 6 Cristian Iorga 2012-10-26 10:30:29 UTC
Also, new events sent between Hob and bitbake needs to be added (at least from Hob to bitbake: NetworkTestCancel).
Comment 7 Cristian Iorga 2012-10-26 14:57:58 UTC
The agreed upon fix is to reduce the test fail timeout.
See details in the discussion below:

From: Barros Pena, Belen 
Sent: Friday, October 26, 2012 5:51 PM
To: Iorga, Cristian
Subject: Re: YB 3248 - Hob: Cancel network test functionality

So what we are saying is that the only alternative is reducing the timeout to 5 seconds. Let's do that then.

Cheers

Belen

From: <Iorga>, Cristian <cristian.iorga@intel.com>
Date: Friday, 26 October 2012 15:47
To: "Belen Barros Pena (Intel)" <belen.barros.pena@intel.com>
Subject: RE: YB 3248 - Hob: Cancel network test functionality

Hello Belen,
See my comments below.
 
From: Barros Pena, Belen 
Sent: Friday, October 26, 2012 5:11 PM
To: Iorga, Cristian
Subject: Re: YB 3248 - Hob: Cancel network test functionality
 
Hi Cristian,
 
I saw your comments: it's seems a hard one. The only alternative I can think of, apart from a timeout, is implementing the test so that your an use Hob while it's running.
>	The timeout is happening anyhow, so the network test will fail only after 30 seconds in which network tools are allowed to try the network connectivity presence. So decreasing that timeout would mean a user will not have to wait a lot before the test will fail, if that’s the case. In my opinion, 30 seconds is too long, as 5 seconds it is enough to see if you are or not connected to internet.
This would mean changing the modality of the Settings dialog. Right now, the Settings dialog is application-modal (I cannot interact with the primary window while the Settings dialog is open). We would need to change it to non-modal, so that users can do stuff in Hob while the Settings dialog is open.  If we change the modality of the Settings dialog, we might consider doing the same for the Advanced configuration and Layers dialogs. 
>	As far as I know, the settings windows (or layers/advanced) cannot be other type than modal, because changes to settings triggers changes into the build system status and the actions it does.
 
 
I am not even sure this is a good idea, since changes on the dialogs can have an effect on the primary Hob window (for example, when changing image types  we need to re-run the recipe parsing process). Any thoughts?
>	Yes, you are right, like we already discussed.
 
Belen
 
From: <Iorga>, Cristian <cristian.iorga@intel.com>
Date: Friday, 26 October 2012 13:15
To: "Belen Barros Pena (Intel)" <belen.barros.pena@intel.com>
Subject: YB 3248 - Hob: Cancel network test functionality
 
Hello Belen,
 
I finished the investigation of this bug and it a difficult one to implement, because it implies changes in the bitbake build system and Hob.
Right now, a network connectivity test will fail after 30 seconds timeout.
That timeout can be decreased to 5 seconds, so the network test will fail in a maximum of 5 seconds.
 
From a  usability point of view and from your point of view, is this an alternative to adding the test cancel functionality?
 
https://bugzilla.yoctoproject.org/show_bug.cgi?id=3248
 
Regards,
Cristian
Comment 8 Cristian Iorga 2012-11-19 14:04:49 UTC
I have tested a solution where the network timeout is set to 5 seconds. Two consecutive tries are made using wget for network connectivity test. As such, the maximum duration of network test is 13 seconds (is the test is failing) and 6 seconds (for a successful network setup).
Comment 9 Belen Barros Pena 2012-11-19 16:03:28 UTC
Thanks, Cristian. 13 seconds sounds quite long, although I would need to try it to be sure (maybe is not that long).

Can I ask why you have decided to implement 2 consecutive tries? Is this just for reliability, or is there another reason?

We do make re-running the test quite easy by providing a re-test button, so maybe a single quick attempt (even if more prone to error) might be a better option. If the attempt fails, you can always rerun the test with a single click.
Comment 10 Cristian Iorga 2012-11-19 17:08:39 UTC
Hello Belen.

Not Hob decides how many retries it does.
This is a mechanism in bitbake.

Hob just invokes a connectivity check test from bitbake.
At the moment, bitbake orders wget to make two attempts of getting some files.

This is the way it is done now, I don't know the exact reasons for being like it is now.
Comment 11 Belen Barros Pena 2012-11-20 10:10:22 UTC
Thanks, Cristian. That explains.

Let's put the fix in Hob and if then we need to change bitbake, we can open a separate issue for that. 

(In reply to comment #10)
> Hello Belen.
> 
> Not Hob decides how many retries it does.
> This is a mechanism in bitbake.
> 
> Hob just invokes a connectivity check test from bitbake.
> At the moment, bitbake orders wget to make two attempts of getting some
> files.
> 
> This is the way it is done now, I don't know the exact reasons for being
> like it is now.
Comment 12 Cristian Iorga 2012-11-28 10:32:22 UTC
Hello,

Further technical clarifications.

My techncal proposal of reducing the network test timeout period cannot be accepted for two reasons:

1. It is the test used during poky build, so if for some reason a sstate mirror or a package website has a very brief outage (or even the build machine network infrastructure), this will crash the build, while two tries with a timeout of 30 seconds will save that build.

2. While testing Build Appliance, it was connected to a network, where the primary DNS server resolved a name request in 16 seconds. So, the network test failed every time, because in that particular Build Appliance instance network test timeout was set to 5 seconds and timeout kicked at every try.

At the moment, the network test in the worst case (no connectivity, network test failure) takes a little bit longer than 1 minute.

The design phase still continues.
Comment 13 Belen Barros Pena 2014-05-14 16:36:07 UTC
At this point, work will take place on toaster, not hob, so marking as won't fix.