Skip to content

Commit

Permalink
Make domainmgr skip DNS with empty DPCKey
Browse files Browse the repository at this point in the history
Do not activate PhysicalIOAdapterList subscription until NIM receives
a DPC and publishes corresponding DNS.
NIM can publish DNS even before it receives first DPC. In such case
DPCKey is empty.
The goal is to avoid assigning network ports to PCIBack if they are going to be
used for management purposes. This way we avoid doing unintended port assignment
to PCIBack that would be shortly followed by a release, therefore mitigating
the risk of race conditions between domainmgr and NIM.

Backported from the master, commit: 53c7ee7

Signed-off-by: Milan Lenco <milan@zededa.com>
  • Loading branch information
milan-zededa committed Jul 7, 2023
1 parent b0b4777 commit a641642
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/pillar/cmd/domainmgr/domainmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -2409,6 +2409,18 @@ func handleDNSImpl(ctxArg interface{}, key string,
log.Functionf("handleDNSImpl: ignoring %s", key)
return
}
if status.DPCKey == "" {
// Do not activate PhysicalIOAdapterList subscription until NIM receives
// a DPC and publishes corresponding DNS.
// NIM can publish DNS even before it receives first DPC. In such case
// DPCKey is empty.
// The goal is to avoid assigning network ports to PCIBack if they are going to be
// used for management purposes. This way we avoid doing unintended port assignment
// to PCIBack that would be shortly followed by a release, therefore mitigating
// the risk of race conditions between domainmgr and NIM.
log.Warnf("handleDNSImpl: DNS with empty DPCKey")
return
}
// Ignore test status and timestamps
// Compare Testing to save its updated value which is used by us
if ctx.deviceNetworkStatus.MostlyEqual(status) &&
Expand Down

0 comments on commit a641642

Please sign in to comment.