[PATCH 1/2] Improve waiting for network connectivity

Brian C. Lane bcl at redhat.com
Tue Jul 9 19:01:29 UTC 2013


On Tue, Jul 09, 2013 at 05:36:37PM +0200, Martin Kolman wrote:
> Make only one function (called by the Network connectivity thread)
> busy wait with shorter interval (0.1s instead 1s) and make other
> callers wait for it to finish. The result is that only one busy
> waiting is in progress at a time and all external callers are
> unblocked at once either when connectivity is available or their
> waiting period is over.
> 
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>  pyanaconda/network.py | 82 ++++++++++++++++++++++++++++++++++++---------------
>  1 file changed, 58 insertions(+), 24 deletions(-)
> 
> diff --git a/pyanaconda/network.py b/pyanaconda/network.py
> index ed8c866..6924759 100644
> --- a/pyanaconda/network.py
> +++ b/pyanaconda/network.py
> @@ -30,6 +30,7 @@ import iutil
>  import socket
>  import os
>  import time
> +import threading
>  import tempfile
>  import simpleconfig
>  import re
> @@ -59,6 +60,12 @@ DEFAULT_HOSTNAME = "localhost.localdomain"
>  HOSTNAME_PART_RE = re.compile(r"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
>  
>  ifcfglog = None
> +
> +
> +NETWORK_CONNECTED_CHECK_INTERVAL = 0.1  # in seconds

Should that be in constants.py?

> +    :type param: integer of float"""

You probably mean 'or' not 'of'

These look ok to me otherwise, but I'd like to see what Radek thinks.

I also wonder what else we can use Condition to clean up.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130709/9a0e6c19/attachment.sig>


More information about the anaconda-patches mailing list