Skip to content

output/flush: Correct EVE flushing logic#15241

Closed
jlucovsky wants to merge 4 commits into
OISF:main-8.0.xfrom
jlucovsky:8400/2
Closed

output/flush: Correct EVE flushing logic#15241
jlucovsky wants to merge 4 commits into
OISF:main-8.0.xfrom
jlucovsky:8400/2

Conversation

@jlucovsky
Copy link
Copy Markdown
Contributor

Continuation of #15107

Backport of changes made for issue 8286 for main-8.0.x backport.

Link to ticket: https://redmine.openinfosecfoundation.org/issues/8400

Describe changes:

Updates:

  • Added note for those with out of tree output plugins about the revision to registration functions.

Provide values to any of the below to override the defaults.

  • To use a Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=

Add flushing logic driven off of the file contexts. This is a simpler
solution that removes the need for logger registration changes.

Overview:
Use the heartbeat-driven thread to periodically flush all registered EVE
contexts via a global flush list.

The global flush list is a mutex-protected TAILQ of LogFileFlushEntry
nodes; each node points to a LogFileCtx. Mutex = log_file_flush_mutex

Periodic flushing performed by a thread according to the
heartbeat.output-flush-interval [1,60]. LogFileFlushAll() is invoked to
initiate flushing of registered LogFileCtx structs; each struct's
fp_mutex is obtained while the flush occurs to synchronize with
LogFileWrite activity.

Interacts with file-rotation via the fp_mutex.

Deadlock prevention: the log_file_flush_mutex must be obtained before
the fp_mutex.

Issue: 8286
(cherry picked from commit a78911f)
Remove packet-based flush logic in favor of simpler solution

Issue: 8286
(cherry picked from commit d0ba1c4)
Remove log flush functions and update registration logic as
context-based flushing doesn't require it.

Issue: 8286
(cherry picked from commit 1923ca1)
Update output flushing description to reflect EVE based approach in
documentation and config template.

Added: Provide update callout for out-of-tree output plugins.

Issue: 8286
(cherry picked from commit e7dc0d8)
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 22.72727% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.57%. Comparing base (5d050a4) to head (8d30e2b).
⚠️ Report is 13 commits behind head on main-8.0.x.

Additional details and impacted files
@@             Coverage Diff             @@
##           main-8.0.x   #15241   +/-   ##
===========================================
  Coverage       81.56%   81.57%           
===========================================
  Files            1012     1012           
  Lines          275213   275139   -74     
===========================================
- Hits           224490   224441   -49     
+ Misses          50723    50698   -25     
Flag Coverage Δ
fuzzcorpus 64.07% <13.63%> (+0.02%) ⬆️
livemode 18.86% <22.72%> (+0.12%) ⬆️
netns 20.04% <22.72%> (-0.02%) ⬇️
pcap 44.59% <22.72%> (+0.01%) ⬆️
suricata-verify 64.87% <22.72%> (+<0.01%) ⬆️
unittests 58.85% <13.63%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa
Copy link
Copy Markdown

Information: QA ran without warnings.

Pipeline = 31021

@victorjulien victorjulien modified the milestones: 9.0, 8.0 May 8, 2026
@victorjulien
Copy link
Copy Markdown
Member

Merged in #15343, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants