Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow fixes/v9 #6438

Merged
merged 4 commits into from
Oct 5, 2021
Merged

Flow fixes/v9 #6438

merged 4 commits into from
Oct 5, 2021

Conversation

victorjulien
Copy link
Member

Misc fixes for freeing flow memory more aggressively after a T-Rex test.

In a scenario where there was suddenly no more traffic flowing, flows
in a threads `flow_queue` would not be processed. The easiest way to
see this would be in a traffic replay scenario. After the replay is done
no more packets come in and these evicted flows got stuck.

In workers mode, the capture part handles timeout this was updated to
take the `ThreadVars::flow_queue` into account.

The autofp mode the logic that puts a flow into a threads `flow_queue`
would already wake a thread up, but the `flow_queue` was then ignored.
This has been updated to take the `flow_queue` into account.

In both cases a "capture timeout" packet is pushed through the pipeline
to "flush" the queues.

Bug: OISF#4722.
Track availability of break loop callback to avoid overhead.
@victorjulien victorjulien requested a review from a team as a code owner October 4, 2021 14:36
@codecov
Copy link

codecov bot commented Oct 4, 2021

Codecov Report

Merging #6438 (fa72a5a) into master (314ec77) will increase coverage by 0.09%.
The diff coverage is 33.92%.

@@            Coverage Diff             @@
##           master    #6438      +/-   ##
==========================================
+ Coverage   76.88%   76.97%   +0.09%     
==========================================
  Files         613      613              
  Lines      186684   186712      +28     
==========================================
+ Hits       143536   143730     +194     
+ Misses      43148    42982     -166     
Flag Coverage Δ
fuzzcorpus 53.02% <2.08%> (+0.28%) ⬆️
suricata-verify 51.61% <34.54%> (-0.05%) ⬇️
unittests 63.12% <0.00%> (-0.01%) ⬇️

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

The flows exceeding the spare pools config setting would be freed
per at max 100 flows a second. After a high speed test this would
lead to excessive memory use for a long time.

This patch updates the logic to free 10% of the excess flows per
run, freeing multiple blocks of flows as needed.

Bug: OISF#4731.
@victorjulien victorjulien merged commit fa72a5a into OISF:master Oct 5, 2021
@victorjulien victorjulien deleted the flow-fixes/v9 branch November 19, 2021 05:36
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 2, 2023
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: OISF#6438
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 2, 2023
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: OISF#6438
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 3, 2023
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: OISF#6438
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 11, 2023
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: OISF#6438
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 11, 2023
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: OISF#6438
victorjulien pushed a commit to victorjulien/suricata that referenced this pull request Nov 14, 2023
With the change to the hash table for tracking threaded loggers, this
call is now called once per thread, so should be changed to the
ThreadDeinit, as that is not longer being called.

Then call Deinit for the primary logger. In threaded mode this would be
the parent, its just the logger in non-threaded mode.

Bug: OISF#6438
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.

1 participant