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

[draft] threads: move wait for unpause outside of loop - v2 #11936

Closed
wants to merge 3 commits into from

Conversation

jasonish
Copy link
Member

Right now, just pushing for QA purposes.

Per #11923 (comment)

The pattern of checking the pause flag, setting to paused then
waiting to unpause was done enough times to factor out into its own
function. This is also needed by library users who bring their own
packet acquisition threads.
TmThreadTestThreadUnPaused was only being used by
TmThreadsWaitForUnpause and is still enough to just become one
function.
Threads are only set to paused upon initialization and never again, we
should only have to wait once, so move the wait before any loop that
was waiting before.
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.73%. Comparing base (58556b7) to head (c22ac05).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11936      +/-   ##
==========================================
- Coverage   82.74%   82.73%   -0.01%     
==========================================
  Files         912      912              
  Lines      249102   249081      -21     
==========================================
- Hits       206117   206081      -36     
- Misses      42985    43000      +15     
Flag Coverage Δ
fuzzcorpus 60.73% <0.00%> (+<0.01%) ⬆️
livemode 18.86% <83.33%> (+0.01%) ⬆️
pcap 44.08% <83.33%> (-0.04%) ⬇️
suricata-verify 62.16% <94.44%> (-0.02%) ⬇️
unittests 59.00% <0.00%> (+<0.01%) ⬆️

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

@@ -406,13 +406,8 @@ static void *StatsMgmtThread(void *arg)
SCLogDebug("stats_thread_data %p", &stats_thread_data);

TmThreadsSetFlag(tv_local, THV_INIT_DONE | THV_RUNNING);
TmThreadsWaitForUnpause(tv_local);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we avoid entering the while loop if this returned early due to the kill flag being set?

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 23086

@jasonish
Copy link
Member Author

Replaced by #11943.

@jasonish jasonish closed this Oct 11, 2024
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