Repository navigation
do not periodically re-read /etc/hosts by default - #11943
Conversation
…osts by default Motivation: After netty#11922, by default `io.netty.resolver.DefaultHostsFileEntriesResolver` synchronously reads `/etc/hosts` every 60 seconds, while before It read `/etc/hosts` once upon instantiation. Modification: By default `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation. This corresponds to io.netty.hostsFileRefreshInterval = 0 Negative values for io.netty.hostsFileRefreshInterval are forbidden Result: `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation, which corresponds to default behaviour prior to netty#11922
|
I am wondering why |
| static { | ||
| DEFAULT_REFRESH_INTERVAL = SystemPropertyUtil.getLong( | ||
| "io.netty.hostsFileRefreshInterval", TimeUnit.SECONDS.toNanos(60)); | ||
| "io.netty.hostsFileRefreshInterval", /*nanos*/0); |
There was a problem hiding this comment.
original pr had io.netty.hostsFileRefreshInterval as nanos - maybe seconds are more appropriate?
|
@mostroverkhov what is wrong with re-reading by default ? |
@normanmaurer This is my perspective: currently with this re-reading the event loop can be blocked. If you are on the server and you want to make a remote call you need always to offload to another thread in order to not block. It was ok to exclude this one netty/common/src/main/java/io/netty/util/internal/Hidden.java Lines 133 to 135 in e90f9bc because you can take care for the initialisation of but now you cannot, because every time when you try to resolve it might try to re-read the file. |
|
@normanmaurer It is blocking call on filesystem , It comes from , so givenresolveAll(..) signature I'd expect most people call It on event loop
|
|
@mostroverkhov @violetagg good point! Thanks a lot! |
…osts by default (#11943) Motivation: After #11922, by default `io.netty.resolver.DefaultHostsFileEntriesResolver` synchronously reads `/etc/hosts` every 60 seconds, while before It read `/etc/hosts` once upon instantiation. Modification: By default `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation. This corresponds to io.netty.hostsFileRefreshInterval = 0 Negative values for io.netty.hostsFileRefreshInterval are forbidden Result: `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation, which corresponds to default behaviour prior to #11922
…osts by default (netty#11943) Motivation: After netty#11922, by default `io.netty.resolver.DefaultHostsFileEntriesResolver` synchronously reads `/etc/hosts` every 60 seconds, while before It read `/etc/hosts` once upon instantiation. Modification: By default `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation. This corresponds to io.netty.hostsFileRefreshInterval = 0 Negative values for io.netty.hostsFileRefreshInterval are forbidden Result: `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation, which corresponds to default behaviour prior to netty#11922
### Motivation Changelog: https://netty.io/news/2022/01/12/4-1-73-Final.html The main reason to upgrade is because of an [intensive I/O disk scheduled task](netty/netty#11943) introduced in 4.1.72.Final which is synchronous and can cause EventLoop to blocked very often. ### Changes * Upgrade Netty from 4.1.72.Final to 4.1.73.Final * [Netty 4.1.73.Final depends on netty-tc-native 2.0.46](https://github.com/netty/netty/blob/b5219aeb4ee62f15d5dfb2b9c29d0c694aca05be/pom.xml#L545) as Netty 4.1.72.Final, so no need to upgrade Reviewers: Andrey Yegorov <None> This closes #3020 from nicoloboschi/upgrade-netty-4.1.73
### Motivation Changelog: https://netty.io/news/2022/01/12/4-1-73-Final.html The main reason to upgrade is because of an [intensive I/O disk scheduled task](netty/netty#11943) introduced in 4.1.72.Final which is synchronous and can cause EventLoop to blocked very often. ### Changes * Upgrade Netty from 4.1.72.Final to 4.1.73.Final * [Netty 4.1.73.Final depends on netty-tc-native 2.0.46](https://github.com/netty/netty/blob/b5219aeb4ee62f15d5dfb2b9c29d0c694aca05be/pom.xml#L545) as Netty 4.1.72.Final, so no need to upgrade Reviewers: Andrey Yegorov <None> This closes apache#3020 from nicoloboschi/upgrade-netty-4.1.73
…osts by default (netty#11943) Motivation: After netty#11922, by default `io.netty.resolver.DefaultHostsFileEntriesResolver` synchronously reads `/etc/hosts` every 60 seconds, while before It read `/etc/hosts` once upon instantiation. Modification: By default `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation. This corresponds to io.netty.hostsFileRefreshInterval = 0 Negative values for io.netty.hostsFileRefreshInterval are forbidden Result: `io.netty.resolver.DefaultHostsFileEntriesResolver` reads `/etc/hosts` once upon instantiation, which corresponds to default behaviour prior to netty#11922
### Motivation Changelog: https://netty.io/news/2022/01/12/4-1-73-Final.html The main reason to upgrade is because of an [intensive I/O disk scheduled task](netty/netty#11943) introduced in 4.1.72.Final which is synchronous and can cause EventLoop to blocked very often. ### Changes * Upgrade Netty from 4.1.72.Final to 4.1.73.Final * [Netty 4.1.73.Final depends on netty-tc-native 2.0.46](https://github.com/netty/netty/blob/b5219aeb4ee62f15d5dfb2b9c29d0c694aca05be/pom.xml#L545) as Netty 4.1.72.Final, so no need to upgrade Reviewers: Andrey Yegorov <None> This closes apache#3020 from nicoloboschi/upgrade-netty-4.1.73
Motivation:
After #11922, by default
io.netty.resolver.DefaultHostsFileEntriesResolversynchronously reads/etc/hostsevery 60 seconds, while prior above change It read/etc/hostsonce upon instantiation.Modification:
By default
io.netty.resolver.DefaultHostsFileEntriesResolverreads/etc/hostsonce upon instantiation. This corresponds to io.netty.hostsFileRefreshInterval = 0Negative values for io.netty.hostsFileRefreshInterval are forbidden
Result:
By default
io.netty.resolver.DefaultHostsFileEntriesResolverreads/etc/hostsonce upon instantiation, which corresponds to behavior before #11922