Skip to content

fix(ingester): clear pooled string slices before reuse#11795

Open
xuezhichao wants to merge 1 commit into
deepflowio:mainfrom
xuezhichao:xzc/clear-pooled-string-slices
Open

fix(ingester): clear pooled string slices before reuse#11795
xuezhichao wants to merge 1 commit into
deepflowio:mainfrom
xuezhichao:xzc/clear-pooled-string-slices

Conversation

@xuezhichao

Copy link
Copy Markdown

This PR is for:

  • Server

Fixes ingester pooled objects retaining old string references

Steps to reproduce the bug

  • Ingest application logs, events, external metrics, or L7 flow logs with many native tag / metric string values.
  • Release the objects back to their pools.
  • The slices are reset with [:0], but their backing arrays still hold references to old strings.
  • Heap memory may stay higher than expected because pooled objects keep those old strings reachable.

Changes to fix the bug

  • Clear string slice elements before reusing pooled ApplicationLogStore.
  • Clear string slice elements before reusing pooled EventStore.
  • Clear string slice elements before reusing pooled ExtMetrics.
  • Clear string slice elements before reusing pooled L7FlowLog.
  • Keep slice capacity for reuse after clearing references.

Affected branches

  • main

Checklist

This change only touches server-side ingester object reuse and does not affect eBPF programs.

  • Added unit test to verify the fix.
  • Verified eBPF program runs successfully on linux 4.14.x.
  • Verified eBPF program runs successfully on linux 4.19.x.
  • Verified eBPF program runs successfully on linux 5.2.x.

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.

1 participant