Repository navigation
Effectively release the dhcp lease - #440
Merged
Merged
Conversation
w13915984028
requested review from
a team,
rrajendran17 and
starbops
as code owners
October 16, 2026 11:03
w13915984028
force-pushed
the
release-dhcp-lease
branch
2 times, most recently
from
October 16, 2026 11:43
3fdb509 to
4f0e34a
Compare
Signed-off-by: Jian Wang <jian.wang@suse.com>
w13915984028
force-pushed
the
release-dhcp-lease
branch
from
October 16, 2026 11:52
4f0e34a to
d2883b4
Compare
w13915984028
requested review from
martindekov
and
a balanced review from Copilot
October 16, 2026 12:01
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes address release ordering with no identified blocking regressions; the documented renewal race remains outside scope.
0 open findings
What changed in this PR
Ensures DHCP lease release occurs before VLAN teardown, preserving connectivity needed to send the release.
Changes:
- Stops the lease manager before removing bridge VLAN configuration.
- Adds release-result logging and closes the DHCP client after a release attempt.
| File | Description |
|---|---|
| pkg/controller/agent/hostnetworkconfig/leasemanager.go | Handles missing leases, logs release results, and closes the client. |
| pkg/controller/agent/hostnetworkconfig/controller.go | Moves lease cleanup ahead of VLAN teardown. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3 tasks
Contributor
|
LGTM, Thanks for the changes as its right to release the lease before vlan is removed from the bridge and not after that. |
rrajendran17
approved these changes
Oct 16, 2026
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
While test #424, we notice:
When a HNC is deleted, the dhcp lease is never trully released. As the controller removes the vlan first.
Client tcpdump
Server log:
Solution:
Do dhcp lease release first before tearing down vlan sub interface.
Related Issue:
harvester/harvester#11757
Test plan:
create HCP in dhcp mode
Delete it.
On DHCP server side, the tcp dump like
sudo tcpdump -i virbr0.100 -e -nn port 67 or port 68log shows one additional dhcp lease log.Network controller has a newly added log:
Note: per comment from vendor/github.com/insomniacslk/dhcp/dhcpv4/nclient4/lease.go, not every dhcp server accept above release, my test
dnsmasqdoes not log above relese log.But, at least, the client side releases the lease effectively.
NOTE: this PR cannot fully solve the potential race case:
(1) background renew timer triggers Renew/Request action (pending)
(2) controller calls cancel & release
It will be fixed on another PR.