Skip to content

feat: add reliable batched HEC delivery#3

Merged
alexb-splunk merged 9 commits into
mainfrom
codex/v1.1-hec-delivery
Jul 8, 2026
Merged

feat: add reliable batched HEC delivery#3
alexb-splunk merged 9 commits into
mainfrom
codex/v1.1-hec-delivery

Conversation

@alexb-splunk

@alexb-splunk alexb-splunk commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • send HecForwarder.forward_events() payloads as one concatenated HEC JSON request
  • add opt-in blocking indexer acknowledgment with a persistent request channel and typed failures
  • add BatchHecForwarder, a bounded in-memory queue with count/byte batching, timed and explicit flushing, backpressure, and fail-closed worker errors
  • let HecHandler opt into the batch forwarder while preserving its synchronous default
  • fix retry handling so a successful retry response is returned to the caller
  • add context manager support and explicit lifecycle documentation

This is intended to produce the v1.1.0 feature release. It preserves the Python 3.9 floor and existing method signatures/default behavior.

The request and acknowledgment behavior follows the current Splunk documentation:

Validation

  • uv --no-config run --no-sync tox -e lint
  • Python 3.9: 45 unit tests passed
  • Python 3.14: 45 unit tests passed
  • source distribution and wheel build passed
  • local PEP 723 smoke harness syntax and lint checks passed

Live HEC smoke validation

The local PEP 723 smoke harness passed against an ephemeral Splunk instance:

  • run ID d431ea2a-b514-4423-b756-4b8671602bd0
  • 30 events across eight synchronous, batched, concurrent, handler-close, and acknowledgment cases
  • standard HEC, indexer-acknowledgment HEC, and management API tokens verified
  • exact SPL counts with no duplicate event IDs

Pre-handoff review

  • simplification lane: approved
  • spec-adherence re-review: approved
  • correctness/reliability re-review: approved
  • six findings resolved with regression coverage

@alexb-splunk alexb-splunk marked this pull request as ready for review July 8, 2026 18:48
Comment thread test/test_handler.py Outdated
@alexb-splunk alexb-splunk merged commit 4689f20 into main Jul 8, 2026
3 checks passed
@alexb-splunk alexb-splunk deleted the codex/v1.1-hec-delivery branch July 8, 2026 22:29
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.

2 participants