Skip to content

Load one module at a time per harvest cycle#1670

Draft
lrafeei wants to merge 3 commits intomainfrom
loaded-modules-fix
Draft

Load one module at a time per harvest cycle#1670
lrafeei wants to merge 3 commits intomainfrom
loaded-modules-fix

Conversation

@lrafeei
Copy link
Contributor

@lrafeei lrafeei commented Feb 25, 2026

This PR attempts to fix an issue where some modules are not loaded in the environment section of the UI (the modules do not get passed into the update_loaded_modules endpoint.)

Previously the logic attempted to load as many modules as possible during a 2 second window by iterating through a plugins generator. However, it seems that some modules get missed (likely iterated but lacking the time to complete the information transfer to the endpoint).

Loading one module per harvest cycle is the attempt at fixing this. If the application completes before all the modules habe had time to load, the agent will revert to the previous connect logic of converting the remaining (unloaded) modules to a list and uploading them at once. The rationale is that the more modules an application has, the higher the likelihood that the application will be running longer as well.

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 1.1s
✅ MARKDOWN markdownlint 7 0 0 0 1.22s
✅ PYTHON ruff 1036 0 0 0 1.19s
✅ PYTHON ruff-format 1036 0 0 0 0.4s
✅ YAML prettier 15 0 0 0 1.62s
✅ YAML v8r 15 0 0 5.25s
✅ YAML yamllint 15 0 0 0.66s

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security

@mergify mergify bot added the tests-failing Tests failing in CI. label Feb 25, 2026
@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.87%. Comparing base (983474f) to head (2454063).

Files with missing lines Patch % Lines
newrelic/core/application.py 28.57% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1670      +/-   ##
==========================================
- Coverage   81.88%   81.87%   -0.02%     
==========================================
  Files         215      215              
  Lines       25861    25851      -10     
  Branches     4108     4107       -1     
==========================================
- Hits        21177    21166      -11     
- Misses       3303     3305       +2     
+ Partials     1381     1380       -1     

☔ 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.

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

Labels

tests-failing Tests failing in CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants