sds: fix handling of cfl_sds return buffers after cfl upgrade#11813
sds: fix handling of cfl_sds return buffers after cfl upgrade#11813edsiper wants to merge 7 commits into
Conversation
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
📝 WalkthroughWalkthroughBumps cmetrics patch version and applies coordinated fixes: Prometheus decoder/lexer error propagation, HTTP client parameter validation and auth-buffer cleanup, plugin/core resource destruction on failures, plus integration test service tracking and teardown. ChangesResource Management and Error Handling Improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/integration/src/utils/test_service.py`:
- Around line 106-110: The current teardown calls self.post_stop(self) which, if
it raises, prevents the subsequent cleanup calls self._restore_env(),
self._allocated_ports.clear(), and _active_services.discard(self) from running;
wrap the post_stop invocation in a try/except/finally (or try/finally) so that
regardless of exceptions from post_stop the environment restore, port clearing,
and active service discard always execute, and ensure any exception from
post_stop is either logged via the existing logger or re-raised after cleanup to
preserve failure visibility.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cd80c00e-fc7c-4cae-a046-8422dabf27bc
📒 Files selected for processing (3)
tests/integration/conftest.pytests/integration/scenarios/out_http/tests/test_out_http_001.pytests/integration/src/utils/test_service.py
| if self.post_stop and had_allocated_ports: | ||
| self.post_stop(self) | ||
| self._restore_env() | ||
| self._allocated_ports.clear() | ||
| _active_services.discard(self) |
There was a problem hiding this comment.
Ensure teardown cleanup always runs even if post_stop fails.
On Line 106, an exception from post_stop will skip Lines 108-110, leaving env vars, allocated ports, and _active_services stale. This can cascade into later tests.
Suggested fix
def stop(self):
had_allocated_ports = bool(self._allocated_ports)
+ stop_error = None
try:
if self.flb:
self.flb.stop()
+ except Exception as exc:
+ stop_error = exc
finally:
- if self.post_stop and had_allocated_ports:
- self.post_stop(self)
- self._restore_env()
- self._allocated_ports.clear()
- _active_services.discard(self)
+ try:
+ if self.post_stop and had_allocated_ports:
+ self.post_stop(self)
+ except Exception as exc:
+ if stop_error is None:
+ stop_error = exc
+ finally:
+ self._restore_env()
+ self._allocated_ports.clear()
+ _active_services.discard(self)
+
+ if stop_error is not None:
+ raise stop_error🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/integration/src/utils/test_service.py` around lines 106 - 110, The
current teardown calls self.post_stop(self) which, if it raises, prevents the
subsequent cleanup calls self._restore_env(), self._allocated_ports.clear(), and
_active_services.discard(self) from running; wrap the post_stop invocation in a
try/except/finally (or try/finally) so that regardless of exceptions from
post_stop the environment restore, port clearing, and active service discard
always execute, and ensure any exception from post_stop is either logged via the
existing logger or re-raised after cleanup to preserve failure visibility.
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit
Bug Fixes
New Features
Chores