Skip to content

fix(datacollector): Return early when client disconnects#4349

Merged
thomaspoignant merged 2 commits intothomaspoignant:mainfrom
hairyhenderson:hairyhenderson/cancel-data-collector-requests-at-context-cancellation-4346
Nov 24, 2025
Merged

fix(datacollector): Return early when client disconnects#4349
thomaspoignant merged 2 commits intothomaspoignant:mainfrom
hairyhenderson:hairyhenderson/cancel-data-collector-requests-at-context-cancellation-4346

Conversation

@hairyhenderson
Copy link
Copy Markdown
Contributor

Description

Fixes #4346 by stopping work early when clients disconnect from /v1/data/collector. While some of the memory use was due to the debug logger (fixed in #4348), much more memory is used when many requests are sent while not stopping execution (and freeing resources) once the client disconnects:

image

Closes issue(s)

Fixes #4346

Checklist

  • I have tested this code
  • I have added unit test to cover this code
  • I have updated the documentation (README.md and /website/docs)
  • I have followed the contributing guide

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 22, 2025

Deploy Preview for go-feature-flag-doc-preview canceled.

Name Link
🔨 Latest commit f636c0b
🔍 Latest deploy log https://app.netlify.com/projects/go-feature-flag-doc-preview/deploys/69249d61efd7260007cd1c27

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.10%. Comparing base (ccca9b0) to head (f636c0b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4349      +/-   ##
==========================================
+ Coverage   85.07%   85.10%   +0.03%     
==========================================
  Files         142      142              
  Lines        5895     5909      +14     
==========================================
+ Hits         5015     5029      +14     
  Misses        663      663              
  Partials      217      217              

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

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Owner

@thomaspoignant thomaspoignant left a comment

Choose a reason for hiding this comment

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

@hairyhenderson thanks again for your contribution this is really a nice addition that can help in high load. 🙇

@thomaspoignant thomaspoignant merged commit b146316 into thomaspoignant:main Nov 24, 2025
24 checks passed
@hairyhenderson hairyhenderson deleted the hairyhenderson/cancel-data-collector-requests-at-context-cancellation-4346 branch November 25, 2025 15:34
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.

(bug) high memory usage and OOMs with large payloads to /v1/data/collector and debug logging

2 participants