Merge ~chad.smith/cloud-init:fix-dhclient-absent-pidfile into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 16ad7eacc3890d219a337ca5d956f696e172854d |
| Proposed branch: | ~chad.smith/cloud-init:fix-dhclient-absent-pidfile |
| Merge into: | cloud-init:master |
| Diff against target: |
320 lines (+118/-48) 5 files modified
cloudinit/net/dhcp.py (+29/-15) cloudinit/net/tests/test_dhcp.py (+61/-5) cloudinit/sources/DataSourceAzure.py (+3/-26) cloudinit/util.py (+22/-0) tests/unittests/test_datasource/test_azure.py (+3/-2) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Server Team CI bot | continuous-integration | Approve on 2017-11-30 | |
| Scott Moser | 2017-11-30 | Approve on 2017-11-30 | |
|
Review via email:
|
|||
Description of the Change
ec2: Fix sandboxed dhclient background process cleanup.
There is a race condition where our sandboxed dhclient properly writes a lease file but has not yet written a pid file. If the sandbox temporary directory is torn down before the dhclient subprocess writes a pidfile DataSourceEc2Local gets a traceback and the instance will fallback to DataSourceEc2 in the init-network stage. This wastes boot cycles we'd rather not spend.
Fix handling of sandboxed dhclient to wait for both pidfile and leasefile before proceding. If either file doesn't show in 5 seconds, log a warning and return empty lease results {}.
LP: #1735331
| Chad Smith (chad.smith) wrote : | # |
PASSED: Continuous integration, rev:c4348d7228d
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/
- 4638684... by Chad Smith on 2017-11-30
- 16ad7ea... by Chad Smith on 2017-11-30
| Chad Smith (chad.smith) wrote : | # |
Pushed changes per review comments, all good suggestions thx
PASSED: Continuous integration, rev:16ad7eacc38
https:/
Executed test runs:
SUCCESS: Checkout
SUCCESS: Unit & Style Tests
SUCCESS: Ubuntu LTS: Build
SUCCESS: Ubuntu LTS: Integration
SUCCESS: MAAS Compatability Testing
IN_PROGRESS: Declarative: Post Actions
Click here to trigger a rebuild:
https:/


Validated on ec2 with a deb built from this branch
looping on dhcp_discovery; maybe_perform_ dhcp_discovery( )'
sudo python3 -c 'from cloudinit.net.dhcp import maybe_perform_
produces no errors and leaks no sandboxed dhclient background processes