While reading IMEXDaemonUpdateLoopWithDNSNames in compute-domain-daemon/main.go, I noticed the TODO suggesting that we might skip sending SIGUSR1 to the IMEX daemon when the updated daemon set only removes nodes:
// TODO: review skipping this also if the new set of IP addresses only strictly removes
// addresses compared to the old set (then we don't need to force the daemon to re-resolve & re-connect).
Currently UpdateDNSNameMappings() only returns a boolean indicating whether the mapping changed, so the caller cannot distinguish between:
- nodes being added
- nodes being removed
- both
As a result the loop always sends SIGUSR1 whenever the mapping changes.
One possible approach could be extending UpdateDNSNameMappings() to compute the diff between the previous and new ipToDNSName maps, allowing the caller to detect additions vs removals and skip the signal when the update only removes nodes.
Before experimenting with a change here, I wanted to check whether this optimization is still desirable, or if there are reasons the current behavior is preferred.
While reading
IMEXDaemonUpdateLoopWithDNSNamesincompute-domain-daemon/main.go, I noticed the TODO suggesting that we might skip sendingSIGUSR1to the IMEX daemon when the updated daemon set only removes nodes:// TODO: review skipping this also if the new set of IP addresses only strictly removes
// addresses compared to the old set (then we don't need to force the daemon to re-resolve & re-connect).
Currently
UpdateDNSNameMappings()only returns a boolean indicating whether the mapping changed, so the caller cannot distinguish between:As a result the loop always sends
SIGUSR1whenever the mapping changes.One possible approach could be extending
UpdateDNSNameMappings()to compute the diff between the previous and newipToDNSNamemaps, allowing the caller to detect additions vs removals and skip the signal when the update only removes nodes.Before experimenting with a change here, I wanted to check whether this optimization is still desirable, or if there are reasons the current behavior is preferred.