spring-cloud-commons: Config not loaded properly when instantiating InetUtils in HostInfoEnvironmentPostProcessor

When org.springframework.cloud.client.HostInfoEnvironmentPostProcessor (on line 60) is trying to use the config from spring.cloud.inetutils for the instantiation of org.springframework.cloud.commons.util.InetUtils, the config isn’t loaded correctly.

InetUtils in org.springframework.cloud.commons.util.UtilAutoConfiguration doesn’t seem to have the same issue, because that one seems to get fully initialized before use.

This leads to a significant startup delay, because I’m using a vEthernet (External switch) adapter from hyper-v to route my internet (this was needed to get LAN IP addresses for my hyper-v VMs). Adding…

spring:
  cloud:
    inetutils:
      preferred-networks:
        - 192.168

…should have fixed this, but due to the config not getting picked up in the post processor, the startup delay is not fully prevented.

spring-cloud-commons version: 4.0.2 sample project: https://github.com/CodeQualIT/CQITFunctions

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16

Most upvoted comments

Confirmed that I now have a startup time of 0.091s

Thanks for the sample, @CC007. I was able to reproduce the issue. We’ll look into it.

Hello @CC007. There are many different modules in that repo. I do not see any properties in https://github.com/CodeQualIT/CQITFunctions/tree/master/pocs/boxedhello-project/boxedhello-generated/boxedhello-clients/boxedhello-helloworld-client; or is this a different module that should be used to reproduce it? Could you maybe provide a minimal sample containing only the modules necessary to reproduce the issue, as well as reproduction steps.

You probably already saw, but the provided git repo is the same as the one from issue https://github.com/spring-cloud/spring-cloud-openfeign/issues/860

If you run it without the “native” profile, you won’t have the problems from that issue. That’ll make it easier to manage those issues separately.