Skip to content

Log load bean exception - #6356

Merged
nvazquez merged 3 commits into
apache:mainfrom
scclouds:show-load-bean-logs
May 19, 2022
Merged

nvazquez merged 3 commits into
apache:mainfrom
scclouds:show-load-bean-logs

Conversation

@JoaoJandre

Copy link
Copy Markdown
Contributor

Description

Currently when ACS fails to load the beans for some component, such as cloud-usage, an exception will be thrown but it is not logged, making the system restart indefinitely. Without any logs, it can be hard to figure out what is happening; to fix that, a try-catch block and a new log were added in the bootstrap of the agent.

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)

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?

This was tested in a local lab, by injecting a class into UsageManagerImpl without mapping its bean and checking if the log would appear and if the component would stop.

Comment thread utils/src/main/java/com/cloud/utils/component/ComponentContext.java Outdated

@GabrielBrascher GabrielBrascher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code LGTM

@sonarqubecloud

sonarqubecloud Bot commented May 4, 2022

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@SadiJr SadiJr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@yadvr

yadvr commented May 18, 2022

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rohityadavcloud a 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.

try {
Object bean = getTargetObject(entry.getValue());
beanFactory.configureBean(bean, entry.getKey());
} catch (BeansException e){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
} catch (BeansException e){
} catch (BeansException e) {

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✔️ suse15. SL-JID 3422

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@sureshanaparti a 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.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3426

@nvazquez

Copy link
Copy Markdown
Contributor

@blueorangutan test

@nvazquez nvazquez added this to the 4.17.0.0 milestone May 18, 2022
@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Object bean = getTargetObject(entry.getValue());
beanFactory.configureBean(bean, entry.getKey());
} catch (BeansException e){
s_logger.error(String.format("Could not load bean due to: [%s]. The service will be stopped. Please investigate the cause of the error or contact your support team.", e.getMessage()), e);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if this means exit, the log level should be fatal

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4204)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37149 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6356-t4204-kvm-centos7.zip
Smoke tests completed. 97 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez
nvazquez merged commit ffc914d into apache:main May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

9 participants