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

Is there something in spring-boot-1.4 which might resolve URL beans? #6813

Closed
malkusch opened this Issue Sep 2, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@malkusch

malkusch commented Sep 2, 2016

I know spring boot is a huge umbrella and chances are very low that it's actually spring related, but maybe this might ring a bell for someone:

I upgraded from spring-boot-starter-parent-1.3.7 to 1.4.0 and noticed a huge difference in startup time. Strace showed me that the application is busy in resolving hostnames. I do have a spring managed bean which does have somewhere inside a huge graph of URL objects. And it happens that exactly these URLs are now resolved during the startup phase.

This log excerpt might indicate in which phase the resolving is happening:

2016-09-02 23:36:23.506 INFO 4382 --- [ost-startStop-1] o.s.web.context.ContextLoader: Root WebApplicationContext: initialization completed in 2783 ms
2016-09-02 23:36:23.785 INFO 4382 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2016-09-02 23:36:23.789 INFO 4382 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'metricFilter' to: [/]
2016-09-02 23:36:23.789 INFO 4382 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/
]
2016-09-02 23:36:23.789 INFO 4382 ---[ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/]
2016-09-02 23:36:23.790 INFO 4382 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/
]
2016-09-02 23:36:23.790 INFO 4382 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/]
2016-09-02 23:36:23.790 INFO 4382 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'webRequestLoggingFilter' to: [/
]
2016-09-02 23:36:24.505 INFO 4382 --- [ main] d.d.a.i.d.w.WSLSelectWhoisServerService : Updating whois server list
2016-09-02 23:36:25.059 INFO 4382 --- [ main] d.d.a.i.d.w.WSLSelectWhoisServerService : updated
2016-09-02 23:39:47.559 INFO 4382 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService
2016-09-02 23:39:47.575 INFO 4382 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'eventbus'
2016-09-02 23:39:47.928 INFO 4382 --- [ main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice:

The WSLSelectWhoisServerService is the bean which contains those URL objects. The log message "updated" comes from the last line of its constructor. The URL objects are part of an object graph which was unmarshalled using JAXB (within said constructor). So there are also JAXB annotations sprinkled within that managed bean. I don't know if Spring reacts on them.

So could it be that with Spring-Boot-1.4 something was introduced which might resolve hostnames of URL objects within a managed bean (containing JAXB annotations)? If yes, how could I turn that off?

Meanwhile I try to provide a SSCCE.

@malkusch

This comment has been minimized.

Show comment
Hide comment
@malkusch

malkusch Sep 2, 2016

Here's a SSCCE.

Starting this application takes forever, as something in
spring-boot-starter-actuator tries to resolve hostnames
of all URL beans (see strace).

The application will start instantly if either not spring-boot-starter-actuator
is on the class path, the List is not a managed bean or
using spring-boot-1.3.7

malkusch commented Sep 2, 2016

Here's a SSCCE.

Starting this application takes forever, as something in
spring-boot-starter-actuator tries to resolve hostnames
of all URL beans (see strace).

The application will start instantly if either not spring-boot-starter-actuator
is on the class path, the List is not a managed bean or
using spring-boot-1.3.7

@wilkinsona

This comment has been minimized.

Show comment
Hide comment
@wilkinsona

wilkinsona Sep 3, 2016

Member

Thanks for the sample. This is due to a change in Spring Framework 4.3. I've opened SPR-14666 to track it.

Member

wilkinsona commented Sep 3, 2016

Thanks for the sample. This is due to a change in Spring Framework 4.3. I've opened SPR-14666 to track it.

@wilkinsona wilkinsona closed this Sep 3, 2016

malkusch added a commit to whois-server-list/whois-server-list-api that referenced this issue Sep 3, 2016

Refactor TopLevelDomain.hashCode()
The original implementation did build a hash over all
fields, including the URL registrationService. Building
a hash for an URL object results in resolving the host
name (i.e. issuing a DNS dialog).

See also: spring-projects/spring-boot#6813
See also: https://jira.spring.io/browse/SPR-14666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment