Skip to content
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

ServerInitializer blocks Tomcat startup for two minutes #4152

Closed
windmueller opened this issue Jan 5, 2023 · 9 comments · Fixed by #4239
Closed

ServerInitializer blocks Tomcat startup for two minutes #4152

windmueller opened this issue Jan 5, 2023 · 9 comments · Fixed by #4239
Assignees
Milestone

Comments

@windmueller
Copy link
Contributor

When Tomcat starts up and finds an already deployed WAR file containing the Eureka server, the startup of this web application hangs for about two minutes after this log:

o.s.c.n.eureka.InstanceInfoFactory       : Setting initial instance status as: STARTING

After some debugging I found that starting the Eureka server also initializes the client in EurekaServerAutoConfiguration#peerAwareInstanceRegistry. Upon client initialization, a request is performed against the currently starting Eureka server. Tomcat seems to block such a request during its own startup, causing the application to pause for about two minutes. This does not happen when starting my application with "bootRun" or redeploying the WAR in Tomcat once it has been started.

I am using Tomcat 10.1.4, Spring Boot 3.0.0 and Spring Cloud Netflix 4.0.0.

@spencergibb
Copy link
Member

Do you mean this line?

Maybe there could be a property that you could set when deploying to a WAR? We don't test WAR deployment of eureka server.

@spring-cloud-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@windmueller
Copy link
Contributor Author

Do you mean this line?

Yes, exactly.

Maybe there could be a property that you could set when deploying to a WAR?

A property for Eureka would be great, since there does not seem a way to configure this behavior in Tomcat.

@spencergibb
Copy link
Member

spencergibb commented Mar 11, 2023

Thanks for the clarification, PRs welcome.

@RobertBleyl
Copy link
Contributor

PR is open now.

RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Apr 26, 2023
@RobertBleyl
Copy link
Contributor

PR is open now.

Further investigation showed that the initial idea does not fix the issue, therefore I closed the PR again. We will continue our investigation.

RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue May 2, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue May 2, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue May 2, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue May 2, 2023
@RobertBleyl
Copy link
Contributor

A new PR is open now which fixes the issue we are having. The "getApplications()" needs to be skipped both for the server and the client in our case.

RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Jul 7, 2023
@RobertBleyl
Copy link
Contributor

It does not seem that the PR has been reviewed yet. Can you tell if this could happen soon? This is important for our Jakarta migration.

RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Oct 23, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Oct 23, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Oct 23, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Oct 23, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Oct 23, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Oct 24, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Nov 9, 2023
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Jan 12, 2024
@RobertBleyl
Copy link
Contributor

I created a new PR that is based on the current main branch (after the 4.1.0 release).
We would appreciate any feedback on this! Are there any issues preventing the PR from being merged?

@OlgaMaciaszek OlgaMaciaszek added this to the 4.1.1 milestone Feb 15, 2024
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Feb 19, 2024
RobertBleyl pushed a commit to RobertBleyl/spring-cloud-netflix that referenced this issue Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment