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

refactor(boot): increases wait timeout for servlets initialization #8947

Merged

Conversation

PatrickfBraz
Copy link
Contributor

Context

Typically in my deployment environment, servlets take anywhere from 20 seconds to 40 seconds to start. Because of this, in addition to the fact that I use more than one GMS replica, at times not all pods start correctly, resulting in the failure to deploy the Helm package to the Kubernetes cluster. Therefore, increasing the servlet initialization timeout can solve this problem for other developers who may experience the same problems.

Logs example:

[main] INFO  o.s.web.servlet.DispatcherServlet:547 - Completed initialization in 3709 ms
INFO:oejshC.ROOT:main: Initializing Spring DispatcherServlet 'authServlet'
[main] WARN  c.l.m.boot.OnBootApplicationListener:50 - OnBootApplicationListener context refreshed! false event: org.springframework.context.event.ContextRefreshedEvent[source=WebApplicationContext for namespace 'authServlet-servlet', started on Wed Oct 04 12:44:57 GMT 2023, parent: Root WebApplicationContext]
...
[main] INFO  o.s.web.servlet.DispatcherServlet:547 - Completed initialization in 16405 ms
INFO:oejshC.ROOT:main: Initializing Spring DispatcherServlet 'openapiServlet'
[main] INFO  o.s.web.servlet.DispatcherServlet:525 - Initializing Servlet 'openapiServlet'
...
[main] INFO  o.s.web.servlet.DispatcherServlet:547 - Completed initialization in 11981 ms
main: Initializing Spring DispatcherServlet 'schemaRegistryServlet'
[main] INFO  o.s.web.servlet.DispatcherServlet:525 - Initializing Servlet 'schemaRegistryServlet'
...
[main] WARN  c.l.m.boot.OnBootApplicationListener:50 - OnBootApplicationListener context refreshed! false event: org.springframework.context.event.ContextRefreshedEvent[source=WebApplicationContext for namespace 'schemaRegistryServlet-servlet', started on Wed Oct 04 12:45:26 GMT 2023, parent: Root WebApplicationContext]
[main] INFO  o.s.web.servlet.DispatcherServlet:547 - Completed initialization in 6409 ms
INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@5f058f00{Open source GMS,/,[file:///tmp/jetty-0_0_0_0-8080-war_war-_-any-10472262629014418870/webapp/, jar:file:///tmp/jetty-0_0_0_0-8080-war_war-_-any-10472262629014418870/webapp/WEB-INF/lib/swagger-ui-4.15.5.jar!/META-INF/resources],AVAILABLE}{file:///datahub/datahub-gms/bin/war.war}
INFO:oejs.AbstractConnector:main: Started ServerConnector@7fc229ab{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
INFO:oejs.Server:main: Started @190466ms
[pool-13-thread-1] INFO  c.l.m.boot.OnBootApplicationListener:73 - Connected! Authentication not tested.
[pool-13-thread-1] INFO  c.l.metadata.boot.BootstrapManager:26 - Starting Bootstrap Process...
[pool-13-thread-1] INFO  c.l.metadata.boot.BootstrapManager:33 - Executing bootstrap step 1/15 with name WaitForSystemUpdateStep...

NOTE: Sometimes the initialization fails even before the schemaRegistryServlet starts.

Tests

Currently, my production environment already has this change and is working perfectly.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@PatrickfBraz
Copy link
Contributor Author

NOTE: I did not set this variable as configured via the environment. However, if necessary, I will make changes.

@github-actions github-actions bot added the devops PR or Issue related to DataHub backend & deployment label Oct 4, 2023
@maggiehays maggiehays added the community-contribution PR or Issue raised by member(s) of DataHub Community label Oct 4, 2023
@PatrickfBraz
Copy link
Contributor Author

PatrickfBraz commented Oct 5, 2023

Now I added the possibility of being configured via environment variable. @RyanHolstien

Copy link
Collaborator

@RyanHolstien RyanHolstien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will merge once CI is green 😄 thanks!

@RyanHolstien RyanHolstien merged commit debac3c into datahub-project:master Oct 5, 2023
36 checks passed
@PatrickfBraz PatrickfBraz deleted the refactor/metadata-boot branch October 5, 2023 21:14
@maggiehays maggiehays added the hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/ label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community devops PR or Issue related to DataHub backend & deployment hacktoberfest-accepted Acceptance for hacktoberfest https://hacktoberfest.com/participation/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants