Skip to content

Don't warn when deferring an on-demand unload - #239

Merged
mjcarroll merged 1 commit into
rollingfrom
mjcarroll/lazy-load-warning
Nov 5, 2026
Merged

mjcarroll merged 1 commit into
rollingfrom
mjcarroll/lazy-load-warning

Conversation

@mjcarroll

@mjcarroll mjcarroll commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #146.

With on-demand load/unload, unloading while instances are alive is expected: onPluginDeletion() unloads the library once the last instance is destroyed. So unloadLibraryInternal() no longer logs the SEVERE warning in that mode. ~ClassLoader() still warns if an on-demand loader is destroyed with live instances, because the deferred unload can't happen then.

The noWarningOnLazyLoad tests now capture console_bridge output and assert there are no warnings. Without the src/ change, both tests fail.

With on-demand load/unload, unloading while instances are alive is
expected: onPluginDeletion() unloads once the last instance is gone.
Only warn in that mode if the ClassLoader itself is destroyed, since the
deferred unload can no longer happen. Make the noWarningOnLazyLoad tests
actually check for warnings.

Fixes #146

Signed-off-by: Michael Carroll <mjcarroll.oss@gmail.com>
@mjcarroll
mjcarroll force-pushed the mjcarroll/lazy-load-warning branch from 04e819b to c040381 Compare November 2, 2026 20:55
@mjcarroll mjcarroll self-assigned this Nov 2, 2026
@mjcarroll
mjcarroll requested a review from ahcorde November 2, 2026 21:06
@mjcarroll

Copy link
Copy Markdown
Member Author

Pulls: #239
Gist: https://gist.githubusercontent.com/mjcarroll/c940d8f8e7f41df4b215129ba20514d8/raw/3fc52998360db3aa1ccaad20fbef45c40df4f95a/ros2.repos
BUILD args: --packages-above-and-dependencies class_loader
TEST args: --packages-above class_loader
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20971

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde

ahcorde commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Pulls: #239
Gist: https://gist.githubusercontent.com/ahcorde/206ea92cf188b5d30a29a091bf0e4393/raw/3fc52998360db3aa1ccaad20fbef45c40df4f95a/ros2.repos
BUILD args: --packages-above-and-dependencies class_loader
TEST args: --packages-above class_loader
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/21021

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@mjcarroll
mjcarroll merged commit 9fa9e3d into rolling Nov 5, 2026
4 checks passed
@ahcorde
ahcorde deleted the mjcarroll/lazy-load-warning branch November 5, 2026 22:47
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.

SEVERE WARNING!!! in tests

3 participants