New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fqdn proxy: fix data race by using separate sessionUDPFactories #28163
fqdn proxy: fix data race by using separate sessionUDPFactories #28163
Conversation
/test |
f2ea482
to
c222929
Compare
/test |
26642d8
to
b4f42da
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could simplify a bit by keeping only one conn pointer in the factory.
PR cilium#25309 introduced a data race by sharing the sessionUDPFactory between the DNS server instances for the different IP families (IPv4 & IPv6). This has been detected by cilium#27979. This commit fixes the data race by using dedicated instances of the sessionUDPFactory. Fixes: cilium#28156 Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
This commit replaces the global response UDP connections (IPv4 & IPv6) variables with fields in the SessionUDPFactory. This way the connections can already be setup during construction of the factory and the `sync.Once`s (global vars) can be removed. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
b4f42da
to
e906486
Compare
Historically, the `socketUDPFactory` and the lilsten configuration supported IPv4 and IPv6 on the same socket. Since the change to bind the DNS servers to localhost, a server and socket is created per ip family. Therefore this commit removes the support for multiple ipfamilies on the same socket (SocketUDPFactory & listen configuration). This improves readability quite a lot. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
4eb30a8
to
761ef40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit I hope you address.
761ef40
to
0770a29
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor thing related to an error string, apart from that LGTM!
This commit adds the transparent socket options to the IPFamily struct. This way it can be used in the respective functions. Signed-off-by: Marco Hofstetter <marco.hofstetter@isovalent.com>
0770a29
to
cd014c8
Compare
Thanks, i adapted the error messages |
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
PR #25309 introduced a data race by sharing the sessionUDPFactory between the DNS server instances for the different IP families (IPv4 & IPv6). This has been detected by #27979.
This commit fixes the data race by using dedicated instances of the sessionUDPFactory.
In addition the global response UDP connections (IPv4 & IPv6) variables have been replaced with fields in the
SessionUDPFactory
. This way the connections can already be setup during construction of the factory and thesync.Once
s (global vars) can be removed.Fixes: #28156