input: add pause/resume callbacks - #10616
Conversation
|
note: this PR needs to be based on top of #10790 (new downstream pause/resume functionality) |
2d4f20b to
c123f0e
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughChangesThe HTTP server now supports pause/resume lifecycle control through downstream connection management. Supported HTTP input plugins register lifecycle callbacks, and integration tests cover protocols, worker modes, connection teardown, metrics, shutdown behavior, and Valgrind execution. ChangesHTTP server pause and resume
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant InputPlugin
participant HTTPServer
participant Downstream
participant MetricsAPI
Client->>InputPlugin: Send pause-triggering request
InputPlugin->>HTTPServer: Pause HTTP server
HTTPServer->>Downstream: Pause and release connections
MetricsAPI-->>Client: Report paused input state
Client->>InputPlugin: Send request while paused
InputPlugin-->>Client: Close or reject connection
Client->>InputPlugin: Send resume request
InputPlugin->>HTTPServer: Resume HTTP server
HTTPServer->>Downstream: Reap stale sessions and resume
MetricsAPI-->>Client: Report resumed input state
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
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/input_pause_resume.py`:
- Around line 61-84: Update the pause/resume test around
wait_for_input_pause_state to establish and retain a client socket or session
before triggering the pause, then verify that the already-active connection is
closed after pause becomes active. Preserve the existing paused-state request
assertion so both active-session teardown and rejection of new requests remain
covered.
🪄 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 Plus
Run ID: 6ecd7cd5-20e2-471b-98c0-f14e44767f70
📒 Files selected for processing (14)
include/fluent-bit/http_server/flb_http_server.hplugins/in_elasticsearch/in_elasticsearch.cplugins/in_http/http.cplugins/in_opentelemetry/opentelemetry.cplugins/in_prometheus_remote_write/prom_rw.cplugins/in_splunk/splunk.csrc/http_server/flb_http_server.ctests/integration/scenarios/in_elasticsearch/config/in_elasticsearch_pause_resume.yamltests/integration/scenarios/in_elasticsearch/tests/test_in_elasticsearch_001.pytests/integration/scenarios/in_http/config/in_http_pause_resume.yamltests/integration/scenarios/in_http/tests/test_in_http_001.pytests/integration/scenarios/in_splunk/config/splunk_pause_resume.yamltests/integration/scenarios/in_splunk/tests/test_in_splunk_001.pytests/integration/src/utils/input_pause_resume.py
c123f0e to
82f3e6f
Compare
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/scenarios/in_http/tests/test_in_http_001.py`:
- Around line 160-170: Update the pause/resume test around
assert_pause_resume_cycles to pass partial_connection into the helper, then
assert connection closure immediately whenever each paused-state observation
occurs rather than only after all cycles complete. Preserve validation of both
successful cycles and failed/paused teardown behavior, and remove the delayed
standalone assertion if the helper now performs it.
🪄 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 Plus
Run ID: 9b8ed12b-ba84-4afd-81f1-6304b412a76a
📒 Files selected for processing (14)
include/fluent-bit/http_server/flb_http_server.hplugins/in_elasticsearch/in_elasticsearch.cplugins/in_http/http.cplugins/in_opentelemetry/opentelemetry.cplugins/in_prometheus_remote_write/prom_rw.cplugins/in_splunk/splunk.csrc/http_server/flb_http_server.ctests/integration/scenarios/in_elasticsearch/config/in_elasticsearch_pause_resume.yamltests/integration/scenarios/in_elasticsearch/tests/test_in_elasticsearch_001.pytests/integration/scenarios/in_http/config/in_http_pause_resume.yamltests/integration/scenarios/in_http/tests/test_in_http_001.pytests/integration/scenarios/in_splunk/config/splunk_pause_resume.yamltests/integration/scenarios/in_splunk/tests/test_in_splunk_001.pytests/integration/src/utils/input_pause_resume.py
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>
6481fbf to
43b1f44
Compare
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>
This patch implements the missing pause and resume callbacks for in_tcp, in_http and in_opentelemetry plugins. When the plugin is paused, all active client connections are forcefully closed, and new incoming connections are rejected. The
plugin tracks its paused state to ensure correct behavior until it is resumed.
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