Skip to content

Conversation

dwisiswant0
Copy link
Member

@dwisiswant0 dwisiswant0 commented Jun 11, 2025

Proposed changes

Fixes #6253

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • Refactor
    • Centralized event data handling into a reusable utility function for improved consistency and maintainability.
  • Chores
    • Removed redundant code and unused imports to streamline the application.

@dwisiswant0 dwisiswant0 requested a review from ehsandeep June 11, 2025 14:31
@auto-assign auto-assign bot requested a review from dogancanbakir June 11, 2025 14:31
Copy link
Contributor

coderabbitai bot commented Jun 11, 2025

"""

Walkthrough

The changes refactor how event data is stored in the previous map by introducing a new utility function, FillPreviousEvent, to centralize and encapsulate this logic. This function is now used in two locations, replacing inline key construction and insertion, and unnecessary imports are removed.

Changes

File(s) Change Summary
pkg/tmplexec/generic/exec.go, pkg/tmplexec/multiproto/multi.go Replaced manual population of previous map with call to utils.FillPreviousEvent; removed unused imports.
pkg/tmplexec/utils/utils.go Added new utility function FillPreviousEvent to manage event data insertion into the previous map.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Template Executor
    participant Utils as utils.FillPreviousEvent
    participant Map as previous Map

    Caller->>Utils: FillPreviousEvent(ID, event, previous)
    Utils->>Map: Insert event data with appropriate keys
    Utils-->>Caller: Return
Loading

Assessment against linked issues

Objective Addressed Explanation
Reduce memory usage during multi-request template execution while preserving request tracking (#6253)
Avoid exponential memory growth by managing event data retention efficiently (#6253)
Centralize and encapsulate logic for populating previous event data (#6253)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Suggested reviewers

  • tarunKoyalwar
  • ehsandeep

Poem

In the warren of code, a new path we pave,
With memory tamed, our templates behave.
A helper now gathers, with keys neat and tight,
No more ballooning RAM in the dead of the night!
🐇✨
"Let events be stored, but not in excess—
For bunnies and bytes both need less stress!"
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee23896 and fbd2d1d.

📒 Files selected for processing (1)
  • pkg/tmplexec/utils/utils.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pkg/tmplexec/utils/utils.go
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Tests (ubuntu-latest)
  • GitHub Check: Tests (macOS-latest)
  • GitHub Check: Tests (windows-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
pkg/tmplexec/utils/utils.go (1)

18-35: Minor micro-optimisations & robustness for FillPreviousEvent

The function does its job, but two very small tweaks could tighten it further:

  1. strings.Builder is allocated once but then Reset() is called every iteration; allocating inside the loop is a bit clearer and avoids holding onto a potentially large backing array between calls (edge-case memory win).
  2. Ignoring the error from previous.Set makes sense today (it always returns nil), but a short comment would future-proof the intent.
-	builder := &strings.Builder{}
-	for k, v := range event.InternalEvent {
+	for k, v := range event.InternalEvent {
+		var builder strings.Builder
 		if reqTypeWithIndexRegex.MatchString(k) {
 			_ = previous.Set(k, v) // always returns nil
 			continue
 		}
-		builder.WriteString(ID)
-		builder.WriteString("_")
-		builder.WriteString(k)
-		_ = previous.Set(builder.String(), v)
-		builder.Reset()
+		builder.WriteString(ID)
+		builder.WriteByte('_')
+		builder.WriteString(k)
+		_ = previous.Set(builder.String(), v) // nolint:errcheck reason: Set never errors today
 	}

Not critical, just polish.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4859df and c0a6f5a.

📒 Files selected for processing (3)
  • pkg/tmplexec/generic/exec.go (2 hunks)
  • pkg/tmplexec/multiproto/multi.go (2 hunks)
  • pkg/tmplexec/utils/utils.go (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
pkg/tmplexec/multiproto/multi.go (1)
pkg/tmplexec/utils/utils.go (1)
  • FillPreviousEvent (18-35)
pkg/tmplexec/generic/exec.go (1)
pkg/tmplexec/utils/utils.go (1)
  • FillPreviousEvent (18-35)
pkg/tmplexec/utils/utils.go (2)
pkg/templates/types/types.go (1)
  • SupportedProtocolsStrings (73-82)
pkg/output/output.go (2)
  • InternalWrappedEvent (100-113)
  • InternalEvent (93-93)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Lint
🔇 Additional comments (5)
pkg/tmplexec/utils/utils.go (1)

12-14: Regex stays frozen at init – remember to re-evaluate when adding new protocols

reqTypeWithIndexRegex is compiled once at package‐init time from the list returned by types.SupportedProtocolsStrings().
If a new protocol is introduced later in the codebase but SupportedProtocolsStrings() is not updated (or its output changes dynamically), the regex will silently miss the new prefix and keys will receive an unwanted ID_ prefix.

Just worth keeping in mind for future protocol additions.

pkg/tmplexec/multiproto/multi.go (2)

12-12: Nice: unnecessary strings import removed

Import list is slimmer after centralising the logic in utils.FillPreviousEvent.


93-93: Centralised previous-event handling – good call

Replacing the former inline key-mangling block with utils.FillPreviousEvent keeps this file lean and eliminates duplicate logic.

pkg/tmplexec/generic/exec.go (2)

10-10: Import change looks clean

Dependency on utils introduced, no other import fallout.


68-69: Refactor improves readability

Delegating to utils.FillPreviousEvent removes several lines of string handling and keeps behaviour consistent with multiproto.

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

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

FYI , we have this memory blow up issue in flow protocol templates as well , if you run any code protocol template like aws audit which has for loop it will exponentially stack all previous events as long as for loop runs

@tarunKoyalwar
Copy link
Member

also just in case i think we should confirm this issue is not happening in flow protocol templates, flow protocol executor doesn't use previous event instead uses a templateCtx map[string]map[string]interface{}` map which is stored in executorOptions

cc: @dwisiswant0

The `FillPreviousEvent` func was modified to
prevent overwriting/duplicating entries in the
previous map.

It now checks if a key `k` from
`event.InternalEvent` already exists in the
previous map. If it does, the key is skipped. This
ensures that if `k` was already set (potentially
w/o a prefix), it's not re-added with an `ID_`
prefix.

Additionally, keys in `event.InternalEvent` that
already start with the current `ID_` prefix are
also skipped to avoid redundant prefixing.

This change simplifies the logic by removing the
`reqTypeWithIndexRegex` and directly addresses the
potential for duplicate / incorrectly prefixed
keys when `event.InternalEvent` grows during
protocol request execution.

Signed-off-by: Dwi Siswanto <[email protected]>
@dwisiswant0
Copy link
Member Author

If we referenced this request in an earlier event template, the derived identifier would be login_en_status_code, not http_status_code.

Thanks for pointing that out, @tarunKoyalwar! Could you please re-review 8f5e2be?

TODO:

  • Functional tests.

@dwisiswant0
Copy link
Member Author

dwisiswant0 commented Jun 16, 2025

Current tests:

basic-template-multiproto (w/ request ID)
id: basic-template-multiproto

info:
  name: Test Template Multiple Protocols
  author: pdteam
  severity: info

http:
  - method: GET
    id: first_iter_http
    path:
      - '{{BaseURL}}/1'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/2'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/3'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/4'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/5'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/6'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/7'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/8'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/9'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/10'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/11'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/12'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/13'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/14'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/15'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/16'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/17'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/18'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"
basic-template-multiproto-raw
id: basic-template-multiproto-raw

info:
  name: Test Template Multiple Protocols RAW
  author: pdteam
  severity: info

http:
  - raw:
      - |
        GET /1 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /2 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /3 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /4 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /5 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /6 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /7 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /8 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /9 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /10 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /11 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /12 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /13 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /14 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /15 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /16 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /17 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /18 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"
basic-template-multiproto-mixed (w/ request ID)
id: basic-template-multiproto-mixed

info:
  name: Test Template Multiple Protocols (Mixed)
  author: pdteam
  severity: info

http:
  - method: GET
    id: first_iter_http
    path:
      - '{{BaseURL}}/1'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/2'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/3'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/4'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/5'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/6'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/7'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/8'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - method: GET
    path:
      - '{{BaseURL}}/9'

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /10 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /11 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /12 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /13 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /14 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /15 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /16 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /17 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

  - raw:
      - |
        GET /18 HTTP/1.1
        Host: {{Hostname}}
        Origin: {{BaseURL}}
        Connection: close
        User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko)
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
        Accept-Language: en-US,en;q=0.9

    matchers:
      - type: word
        words:
          - "Test is test matcher text"

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a comment

Choose a reason for hiding this comment

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

lgtm !

for context, similar issue that exists in flow but with different root cause is already being tracked in this issue #5352

@ehsandeep ehsandeep merged commit a326f39 into dev Jun 16, 2025
22 checks passed
@ehsandeep ehsandeep deleted the fixed-memory-blowup-multiproto branch June 16, 2025 23:23
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.

Excessive memory usage with multi request / protocol template
5 participants