Skip to content

fix(unit tests): test_udp_syslog can overflow default size receive buffer#24878

Merged
pront merged 1 commit intovectordotdev:masterfrom
strophy:fix-udp-syslog-receive-buffer
Mar 11, 2026
Merged

fix(unit tests): test_udp_syslog can overflow default size receive buffer#24878
pront merged 1 commit intovectordotdev:masterfrom
strophy:fix-udp-syslog-receive-buffer

Conversation

@strophy
Copy link
Copy Markdown
Contributor

@strophy strophy commented Mar 10, 2026

Summary

test_udp_syslog sends out 1000 UDP datagrams with no delay, which can saturate the kernel UDP receive buffer, depending on the environment. Specifically in Alpine Linux CI, this test was causing consistent failures. The test failure looks like this:

  TRY 4 FAIL [   2.192s] (2650/2654) vector sources::syslog::test::test_udp_syslog
  stdout ───
    running 1 test
    test sources::syslog::test::test_udp_syslog ... FAILED
    failures:
    failures:
        sources::syslog::test::test_udp_syslog
    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1834 filtered out; finished in 2.18s
  stderr ───
    thread 'sources::syslog::test::test_udp_syslog' (46526) panicked at src/sources/syslog.rs:1253:13:
    assertion `left == right` failed
      left: 917
     right: 1000
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This PR specifies receive_buffer_bytes of 4MB which should be sufficient for the amount of data sent in the test, which I estimate to be around 500KB. This is typically doubled for overhead/padding, and then I added more headroom just to make sure, since this buffer sizing only applies during this specific test.

Vector configuration

Build from source, then:

	cargo nextest run \
		--fail-fast \
		--frozen \
		--no-default-features \
		--features default-musl,component-validation-runner \
		--offline \
		--release \
		--workspace \
		--test-threads num-cpus

How did you test this PR?

In Alpine Linux CI, test passes on x86_64, aarch64, ppc64le and riscv64

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

@strophy strophy requested a review from a team as a code owner March 10, 2026 09:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 10, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions bot added the domain: sources Anything related to the Vector's sources label Mar 10, 2026
@strophy
Copy link
Copy Markdown
Contributor Author

strophy commented Mar 10, 2026

I have read the CLA Document and I hereby sign the CLA

@strophy strophy mentioned this pull request Mar 10, 2026
@pront pront added the no-changelog Changes in this PR do not need user-facing explanations in the release changelog label Mar 10, 2026
Copy link
Copy Markdown
Member

@pront pront left a comment

Choose a reason for hiding this comment

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

Hi @strophy, thanks, I will merge this tomorrow.

@pront pront added this pull request to the merge queue Mar 11, 2026
Merged via the queue into vectordotdev:master with commit 356409d Mar 11, 2026
69 of 72 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: sources Anything related to the Vector's sources no-changelog Changes in this PR do not need user-facing explanations in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alpine packages

2 participants