Skip to content

Fix NPE while stopping the RabbitMQEventBus bean when there is no connection established with RabbitMQ Event Bus#12635

Open
sureshanaparti wants to merge 1 commit intoapache:4.20from
shapeblue:rabbitmq-npe-issue
Open

Fix NPE while stopping the RabbitMQEventBus bean when there is no connection established with RabbitMQ Event Bus#12635
sureshanaparti wants to merge 1 commit intoapache:4.20from
shapeblue:rabbitmq-npe-issue

Conversation

@sureshanaparti
Copy link
Contributor

Description

This PR fixes the NPE issue while stopping the RabbitMQEventBus bean when there is no connection established with RabbitMQ Event Bus

Fixes #12634

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?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 16.25%. Comparing base (34f6f41) to head (9f9ed83).

Files with missing lines Patch % Lines
...ache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #12635      +/-   ##
============================================
- Coverage     16.25%   16.25%   -0.01%     
+ Complexity    13421    13420       -1     
============================================
  Files          5662     5662              
  Lines        500141   500141              
  Branches      60728    60728              
============================================
- Hits          81299    81297       -2     
- Misses       409759   409761       +2     
  Partials       9083     9083              
Flag Coverage Δ
uitests 4.15% <ø> (ø)
unittests 17.10% <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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a NullPointerException that occurs when stopping the CloudStack management server with RabbitMQ event bus configured but without an established connection to RabbitMQ. The issue was reported in #12634 and occurs when the RabbitMQ server is stopped before the CloudStack management server attempts to shut down.

Changes:

  • Added null check before calling s_connection.isOpen() in the stop() method to prevent NPE when the connection was never established or already closed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@blueorangutan
Copy link

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

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-15445)

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.

NPE found when rabbitmq event bus is configured with cloudstack

3 participants