Skip to content

framework/spring: throw RuntimeException when fail to start or load a module#13186

Open
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-terminate-startup-when-fail
Open

framework/spring: throw RuntimeException when fail to start or load a module#13186
weizhouapache wants to merge 1 commit into
apache:4.22from
weizhouapache:4.22-terminate-startup-when-fail

Conversation

@weizhouapache
Copy link
Copy Markdown
Member

Description

This PR fixes the issue that when fail to start cloudstack-management service, there are huge amount of logs which are misleading and difficult to address the root cause.

Steps to reproduce the issue

  • use a wrong db username in /etc/cloudstack/management/db.properties, for example
db.cloud.username=wronguser
  • restart cloudstack-management service

Prior, there are hundreds of errors like No bean named 'DefaultConfigResources' available

# grep "No bean named 'DefaultConfigResources' available" /var/log/cloudstack/management/management-server.log |wc -l
372

With this change, these errors do not appear. only get few errors like

2026-05-19 06:49:17,187 DEBUG [c.c.u.d.T.Transaction] (main:[]) (logid:) Creating default datasource for database: cloud with connection pool lib: hikaricp
2026-05-19 06:49:17,191 DEBUG [c.c.u.d.T.Transaction] (main:[]) (logid:) Creating default datasource for database: cloud_usage with connection pool lib: hikaricp
2026-05-19 06:49:17,194 DEBUG [c.c.u.d.T.Transaction] (main:[]) (logid:) Creating default datasource for database: simulator with connection pool lib: hikaricp
2026-05-19 06:49:17,196 WARN  [c.c.u.d.T.Transaction] (main:[]) (logid:) Unable to load db configuration, using defaults with 5 connections. Falling back on assumed datasource on localhost:3306 using username:password=cloud:cloud. Please check your configuration com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
...

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@weizhouapache weizhouapache added this to the 4.22.2 milestone May 19, 2026
@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.67%. Comparing base (4a49ffa) to head (d831f37).

Files with missing lines Patch % Lines
.../module/model/impl/DefaultModuleDefinitionSet.java 0.00% 4 Missing ⚠️
.../spring/lifecycle/CloudStackExtendedLifeCycle.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.22   #13186      +/-   ##
============================================
- Coverage     17.67%   17.67%   -0.01%     
+ Complexity    15788    15787       -1     
============================================
  Files          5922     5922              
  Lines        533123   533126       +3     
  Branches      65201    65201              
============================================
- Hits          94242    94237       -5     
- Misses       428237   428244       +7     
- Partials      10644    10645       +1     
Flag Coverage Δ
uitests 3.69% <ø> (ø)
unittests 18.75% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17906

@weizhouapache
Copy link
Copy Markdown
Member Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants