Skip to content

fix(dhcp): unlink notification socket on service stop - #676

Queued
skyecas wants to merge 6 commits into
canonical:masterfrom
skyecas:fix/dhcpd-sock-cleanup
Queued

skyecas wants to merge 6 commits into
canonical:masterfrom
skyecas:fix/dhcpd-sock-cleanup

Conversation

@skyecas

@skyecas skyecas commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Terminating the configure-dhcp-service leaves an orphaned socket file on disk, causing cascading failures.
This adds an explicit socket unlink to storp() to ensure downstream attempts aren't failed.
Additionally add clearer failure logging so this issue is easier to debug in future

Resolves LP:2167838

@skyecas
skyecas requested a review from a team September 21, 2026 11:15
github-actions[bot]

This comment was marked as outdated.

@skyecas
skyecas force-pushed the fix/dhcpd-sock-cleanup branch 2 times, most recently from 48605ec to b6e765d Compare September 21, 2026 12:47
@skyecas skyecas added the bug label Sep 21, 2026
github-actions[bot]

This comment was marked as outdated.

@skyecas
skyecas force-pushed the fix/dhcpd-sock-cleanup branch from b6e765d to ac74107 Compare September 21, 2026 13:00
- Unlink notification socket on service stop to prevent stale sockets
- Clean up stale sockets on rackd startup (deb equivalent of snap's run-rackd)
- Handle partial socket states in start() (close and remove on Chmod failure)
- Catch FileNotFoundError/ConnectionRefusedError in maas-dhcp-helper

Resolves LP:2167838
@skyecas
skyecas force-pushed the fix/dhcpd-sock-cleanup branch from ac74107 to 8b1d732 Compare September 21, 2026 13:05
github-actions[bot]

This comment was marked as outdated.

- Move conn.connect() inside closing() block in helper
- Add PermissionError catch in helper
- Fix server.py imports to top-level, add logging
- Fix test_server.py to actually test exception path with mock
- Add stderr assertion to helper dir-missing test
@skyecas
skyecas enabled auto-merge September 22, 2026 09:46
@skyecas
skyecas added this pull request to the merge queue Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants