Closed Luap99 closed 1 month ago
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Luap99
The full list of commands accepted by this bot can be found here.
The pull request process is described here
@mheon PTAL
Integration tests failed. @containers/packit-build please check.
LGTM
@mheon @baude PTAL and merge
/lgtm
Right now we read resolv.conf once at the start for each network server, this means if resolv.conf on the host changes it keeps using the old nameservers. This commit changes this to pass the same vector around for each thread. Due to rust abstractions this requires the use of a Arc<Mutex<_>> to safly share the vector between threads. Note I am using .expect() here to access the value which causes a panic on error. However if you read the docs on the mutex the only way this errors is when the thread holding the lock panicked in which case it is best for us to abort anyway.
This is still not perfect as we only refresh when a new container is started/stopped but better than not updating it at all. Long term some inotify watcher (or polling) would be better.