Skip to content

[fbreceiver] Ignore cgo DNS goroutines in goleak leak checker on macOS#52140

Draft
macdewee wants to merge 2 commits into
mainfrom
drosiek-fix-fbreceiver-goleak
Draft

[fbreceiver] Ignore cgo DNS goroutines in goleak leak checker on macOS#52140
macdewee wants to merge 2 commits into
mainfrom
drosiek-fix-fbreceiver-goleak

Conversation

@macdewee

Copy link
Copy Markdown
Contributor

Proposed commit message

WHAT: Add goleak.IgnoreAnyFunction("net.cgoResSearch") to the skip list in oteltest.VerifyNoLeaks. This is the same pattern already used for net.(*netFD).connect and net/http.(*Transport).startDialConnForLocked.

WHY: TestLeak, TestNewReceiver, and TestMultipleReceivers in x-pack/filebeat/fbreceiver fail intermittently on macos-15-intel CI runners. The goroutine leak checker detects a goroutine stuck for ~1 minute in a cgo DNS res_nsearch syscall (net.cgoResSearchsyscall.syscalln). This is a networking/infrastructure issue on the runner where a DNS lookup issued during the test never returns — not a real leak in production code. The filter is narrow and targets only that specific cgo DNS frame.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. (test infrastructure change; the leak only manifests on macOS CI)
  • I have added an entry in ./changelog/fragments using the changelog tool. (test-only change)

Disruptive User Impact

None. Test infrastructure change only.

How to test this PR locally

The DNS hang only occurs on restricted macOS CI networking and is not reliably reproducible locally. Verify that the existing fbreceiver tests still pass:

cd x-pack/filebeat
go test ./fbreceiver/... -v -count=1

Related issues

Logs

=== FAIL: x-pack/filebeat/fbreceiver TestLeak/unhealthy_consumer (6.73s)
    oteltest.go:251: found unexpected goroutines:
        [Goroutine 54 in state syscall, 1 minutes, with syscall.syscalln on top of the stack:
        syscall.syscalln(...)
        internal/syscall/unix.ResNsearch(...)
        net._C_res_nsearch(...)
        net.cgoResSearch(...)
        net.resSearch.func1()
        net.doBlockingWithCtx[...].func1()
        ]

macdewee and others added 2 commits July 21, 2026 15:49
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 21, 2026
@botelastic

botelastic Bot commented Jul 21, 2026

Copy link
Copy Markdown

This pull request doesn't have a Team:<team> label.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mergify

mergify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @macdewee? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@macdewee macdewee changed the title Drosiek fix fbreceiver goleak [fbreceiver] Ignore cgo DNS goroutines in goleak leak checker on macOS Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant