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

Add commandline option to simulate alert queue expand failure- v1 #7403

Closed

Conversation

jufajardini
Copy link
Contributor

@jufajardini jufajardini commented May 11, 2022

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

Describe changes:

  • add the command-line option --disable-alert-queue-expand that, when passed as an argument, will skip reallocating the alert queue, once it reaches packet alert max. This allows for one to test Suri behavior if reallocating fails.

This must merged after #7396 as it exposes bug 5353

suricata-verify-pr: 825
OISF/suricata-verify#825

For testing purposes. Meant to simulate a reallocation failure when
dynamically growing the alert queue in DetectEngineThreadCtx, so we can
check that Suri's behavior doesn't break under such circumstances.

Task OISF#5319
@@ -221,7 +221,10 @@ void AlertQueueFree(DetectEngineThreadCtx *det_ctx)
static uint16_t AlertQueueExpand(DetectEngineThreadCtx *det_ctx)
{
Copy link
Member

Choose a reason for hiding this comment

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

A check like below the start of the function would make more sense to me:

static uint16_t AlertQueueExpand(DetectEngineThreadCtx *det_ctx)
{
#ifdef DEBUG
    if (unlikely(is_alert_queue_fail_mode))
        return det_ctx->alert_queue_capacity;
#endif
    ... rest of the func ...

@victorjulien
Copy link
Member

I think it would make sense to model the option after the work here https://github.com/OISF/suricata/pull/7393/files#diff-dc589ac7f5fdeb0157360264d2fa5a02574ee3359be4841a0a59f333d33e06abR116

@suricata-qa
Copy link

ERROR:

ERROR: QA failed on tlpw1_files_sha256.

ERROR: QA failed on tlpr1_alerts_cmp.

Pipeline 7472

@jufajardini
Copy link
Contributor Author

Replaced by: #7527

@jufajardini jufajardini deleted the alert-expand-fail-5319/v1 branch August 2, 2022 12:15
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 20, 2024
To be used by the requires keyword to check for keyword support.

Ticket: OISF#7403
jasonish added a commit to jasonish/suricata that referenced this pull request Nov 20, 2024
For example:

    requires: keyword foo;

Will require that Suricata supports the "foo" keyword.

Ticket: OISF#7403
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