Merge lp://staging/~brendan-donegan/checkbox/bug1070497 into lp://staging/checkbox

Proposed by Brendan Donegan
Status: Merged
Approved by: Zygmunt Krynicki
Approved revision: 1800
Merged at revision: 1818
Proposed branch: lp://staging/~brendan-donegan/checkbox/bug1070497
Merge into: lp://staging/checkbox
Diff against target: 150 lines (+52/-40)
2 files modified
debian/changelog (+2/-0)
scripts/internet_test (+50/-40)
To merge this branch: bzr merge lp://staging/~brendan-donegan/checkbox/bug1070497
Reviewer Review Type Date Requested Status
Zygmunt Krynicki (community) Approve
Review via email: mp+133951@code.staging.launchpad.net

Description of the change

Recently we've been seeing a lot of problems with systems that succesfully create a wireless connection but fail the subsequent connectivity check. The problem was found to be that the code which tries to populate the ARP cache was assuming this would happen quite quickly, and when it didn't it was failing. This branch polls for the ARP cache to be succesfully populated over 10 seconds, only failing if it isn't after that period of time.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Seems like something that's broken

18 -#!/usr/bin/env python3
19 +#! /usr/bin/python3

review: Needs Fixing
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

54 + while (current_time - start_time).seconds < ARP_WAIT:
56 + known_ips = subprocess.check_output(["arp", "-a", "-n"])

This is wrong on two accounts:

1) It is a busy loop that spawns processes. We should really wait between iterations.
2) It a time loop using wall clock time. This makes it susceptible to various clock shift issues (for instance, ntp clock adjustment)

To fix 1 I'd add a simple delay (it's better to be event triggered but here we don't have that luxury

To fix 2 I'd convert this to an explicit loop of X attempts that break as soon as an attempt succeeds.

review: Needs Fixing
1799. By Brendan Donegan

Use limited number of polls instead of a time period.

1800. By Brendan Donegan

Fixed shebang and a few pep8 fixes.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

+1

I'd use for i in range(...) myself but this is a tiny detail

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches