Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from netdata:master #304

Merged
merged 4 commits into from
Jan 17, 2025
Merged

Conversation

pull[bot]
Copy link

@pull pull bot commented Jan 17, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Fix memory leaks in the metadata event loop, stream parents, and pulse daemon memory system. Correctly report glibc and Netdata memory maps in the pulse daemon. Add issue type to issue templates.

Bug Fixes:

  • Fix memory leaks in the metadata event loop, stream parents, and pulse daemon memory system.
  • Correctly swap glibc and Netdata memory maps in the pulse daemon memory system charts.

Enhancements:

  • Include full JSON payload in stream parent logs when failing to extract fields from stream info response.

ktsaou and others added 4 commits January 17, 2025 11:31
* log stream_info payload when it cannot be parsed

* log incorrect status information in stream info parsing
Cleanup during shutdown if needed (address coverity warning)
@pull pull bot added the ⤵️ pull label Jan 17, 2025
@pull pull bot merged commit 5559047 into webfutureiorepo:master Jan 17, 2025
Copy link

sourcery-ai bot commented Jan 17, 2025

Reviewer's Guide by Sourcery

This pull request introduces several bug fixes and improvements to the Netdata Agent. It fixes memory allocation issues in the metadata event loop, corrects the handling of status codes in stream info parsing, swaps the order of glibc and Netdata memory maps in the pulse daemon, and updates issue templates.

Sequence diagram for stream info error handling flow

sequenceDiagram
    participant Client
    participant StreamParent
    participant JSONParser

    Client->>StreamParent: Request stream info
    StreamParent->>JSONParser: Parse stream info response
    alt Status not OK
        JSONParser-->>StreamParent: Return false with error
        StreamParent->>StreamParent: Reset DB parameters
        StreamParent-->>Client: Log detailed error with JSON payload
    end
Loading

Class diagram for metadata cleanup structure

classDiagram
    class CleanupData {
        +JudyL* JudyL
        +char* machine_guid
    }

    class HostCtxCleanup {
        +string* context
    }

    class PendingList {
        +JudyL* JudyL
    }

    CleanupData --> PendingList
    HostCtxCleanup --> PendingList

    note for CleanupData "Added memory cleanup"
    note for HostCtxCleanup "Added context cleanup"
Loading

Flow diagram for metadata event loop cleanup

graph TD
    A[Start Cleanup] --> B{Check cl_cleanup_data}
    B -->|Exists| C[Free machine_guid]
    C --> D[Free JudyL array]
    D --> E{Check pending_ae_list}
    B -->|Not exists| E
    E -->|Exists| F[Free JudyL array]
    F --> G{Check pending_ctx_cleanup}
    E -->|Not exists| G
    G -->|Exists| H[Free context]
    H --> I[Free cleanup structure]
    G -->|Not exists| J[End Cleanup]
    I --> J
Loading

File-Level Changes

Change Details Files
Fix memory leaks in the metadata event loop by freeing allocated memory for machine GUIDs, pending AEs, and host context cleanup.
  • Free machine GUIDs stored in cl_cleanup_data.
  • Free memory associated with pending AEs.
  • Free memory used by host context cleanup, including the context string.
src/database/sqlite/sqlite_metadata.c
Improve error reporting in stream_info_json_parse_v1 by including the actual status code received.
  • Add the received status code to the error message.
  • Include the JSON payload in the log message for debugging.
src/streaming/stream-parents.c
Correct the order of glibc and Netdata memory maps in pulse_daemon_memory_system_do.
  • Swap the order of setting rd_glibc and rd_netdata to reflect the correct memory map values.
src/daemon/pulse/pulse-daemon-memory-system.c
Update issue templates to include the type of issue.
  • Add type: "bug" to the bug report template.
  • Add type: "feature" to the feature request template.
.github/ISSUE_TEMPLATE/BUG_REPORT.yml
.github/ISSUE_TEMPLATE/FEAT_REQUEST.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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

Successfully merging this pull request may close these issues.

3 participants