Repository navigation
fix(processors.filepath): Prevent test code from being included in the shipped binary - #19315
Conversation
a0624f5 to
4eaa6a9
Compare
f3a0e78 to
eb10bf7
Compare
eb10bf7 to
9ab2f52
Compare
|
Checked this from the dependency side: on master On macOS I could not measure any startup difference (0.13 to 0.15 s either way), since gopsutil goes through sysctl there rather than /proc, so it might be worth getting a before and after from the reporter on #17709 to close it on a measurement rather than a trace. Same leak is still open elsewhere, not a blocker for this one: testify ships in the binary through five files that are not Also, check-deps.sh already computes the binary's dependency list and runs in CI, so it had testcontainers in its output all along and passed because the license file listed it too. A denylist of test only modules there would have caught this on the PR that introduced it. |
|
@skartikey can you please open issues for the remaining leakers?! We should fix them one-by-one. Regarding feedback: The reporter confirmed that this fixes the issue for the machine that took ~120s before in the issue. You need a very special setup with a lot of processes to make this measureable that's why this issue surfaces almost never... |
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
telegraf 1.39.3 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre> ## v1.39.3 [2026-08-10] ### Bugfixes - [#19366](influxdata/telegraf#19366) `inputs.cisco_telemetry_mdt` Check attribute message length - [#19332](influxdata/telegraf#19332) `inputs.execd` Respect influx parser parameters - [#19333](influxdata/telegraf#19333) `inputs.redfish` Skip resources without a reference - [#19354](influxdata/telegraf#19354) `parsers.avro` Resolve measurement name from items record for array schemas - [#19315](influxdata/telegraf#19315) `processors.filepath` Prevent test code from being included in the shipped binary - [#19325](influxdata/telegraf#19325) `serializers.prometheusremotewrite` Accumulate multiple samples per series in a batch ### Dependency Updates - [#19302](influxdata/telegraf#19302) `deps` Bump actions/setup-go from 6 to 7 - [#19335](influxdata/telegraf#19335) `deps` Bump cloud.google.com/go/storage from 1.63.1 to 1.64.0 - [#19311](influxdata/telegraf#19311) `deps` Bump github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor from 0.12.0 to 0.13.0 - [#19385](influxdata/telegraf#19385) `deps` Bump github.com/IBM/sarama from 1.60.0 to 1.60.1 - [#19386](influxdata/telegraf#19386) `deps` Bump github.com/SAP/go-hdb from 1.16.12 to 1.17.2 - [#19303](influxdata/telegraf#19303) `deps` Bump github.com/antchfx/xpath from 1.3.6 to 1.3.7 - [#19341](influxdata/telegraf#19341) `deps` Bump github.com/antchfx/xpath from 1.3.7 to 1.3.8 - [#19344](influxdata/telegraf#19344) `deps` Bump github.com/apache/arrow-go/v18 from 18.6.0 to 18.7.0 - [#19313](influxdata/telegraf#19313) `deps` Bump github.com/aws/smithy-go from 1.27.3 to 1.27.4 - [#19340](influxdata/telegraf#19340) `deps` Bump github.com/aws/smithy-go from 1.27.4 to 1.27.5 - [#19310](influxdata/telegraf#19310) `deps` Bump github.com/go-ldap/ldap/v3 from 3.4.13 to 3.4.14 - [#19381](influxdata/telegraf#19381) `deps` Bump github.com/gofrs/uuid/v5 from 5.4.0 to 5.5.0 - [#19345](influxdata/telegraf#19345) `deps` Bump github.com/google/cel-go from 0.29.2 to 0.30.0 - [#19314](influxdata/telegraf#19314) `deps` Bump github.com/gosnmp/gosnmp from 1.43.2 to 1.44.0 - [#19306](influxdata/telegraf#19306) `deps` Bump github.com/jedib0t/go-pretty/v6 from 6.8.2 to 6.8.3 - [#19312](influxdata/telegraf#19312) `deps` Bump github.com/klauspost/compress from 1.19.0 to 1.19.1 - [#19336](influxdata/telegraf#19336) `deps` Bump github.com/moby/moby/client from 0.5.0 to 0.5.1 - [#19380](influxdata/telegraf#19380) `deps` Bump github.com/nats-io/nats-server/v2 from 2.14.3 to 2.14.4 - [#19309](influxdata/telegraf#19309) `deps` Bump github.com/prometheus/client_golang from 1.23.2 to 1.24.0 - [#19342](influxdata/telegraf#19342) `deps` Bump github.com/prometheus/client_golang from 1.24.0 to 1.24.1 - [#19382](influxdata/telegraf#19382) `deps` Bump github.com/prometheus/prometheus from 0.313.1 to 0.313.2 - [#19349](influxdata/telegraf#19349) `deps` Bump github.com/rabbitmq/amqp091-go from 1.12.0 to 1.13.0 - [#19387](influxdata/telegraf#19387) `deps` Bump github.com/rclone/rclone from 1.74.1-0.20260628215305-6bbc28cf02dc to 1.75.0 - [#19372](influxdata/telegraf#19372) `deps` Bump github.com/shirou/gopsutil/v4 from v4.26.6 to v4.26.7 - [#19348](influxdata/telegraf#19348) `deps` Bump github.com/vertica/vertica-sql-go from 1.3.7 to 1.3.8 - [#19384](influxdata/telegraf#19384) `deps` Bump github.com/yuin/goldmark from 1.8.4 to 1.8.5 - [#19347](influxdata/telegraf#19347) `deps` Bump go.opentelemetry.io/collector/pdata from 1.62.0 to 1.63.0 - [#19338](influxdata/telegraf#19338) `deps` Bump go.opentelemetry.io/proto/otlp from 1.10.0 to 1.11.0 - [#19351](influxdata/telegraf#19351) `deps` Bump go.opentelemetry.io/proto/otlp/collector/profiles/v1development from 0.3.0 to 0.4.0 - [#19353](influxdata/telegraf#19353) `deps` Bump go.opentelemetry.io/proto/otlp/profiles/v1development from 0.3.0 to 0.4.0 - [#19307](influxdata/telegraf#19307) `deps` Bump go.step.sm/crypto from 0.84.1 to 0.85.0 - [#19389](influxdata/telegraf#19389) `deps` Bump go.step.sm/crypto from 0.85.0 to 0.87.0 - [#19352](influxdata/telegraf#19352) `deps` Bump go.yaml.in/yaml/v3 from 3.0.4 to 3.0.5 - [#19308](influxdata/telegraf#19308) `deps` Bump google.golang.org/api from 0.288.0 to 0.289.0 - [#19339](influxdata/telegraf#19339) `deps` Bump google.golang.org/api from 0.289.0 to 0.290.0 - [#19388](influxdata/telegraf#19388) `deps` Bump google.golang.org/api from 0.290.0 to 0.291.0 - [#19305](influxdata/telegraf#19305) `deps` Bump google.golang.org/grpc from 1.82.0 to 1.82.1 - [#19390](influxdata/telegraf#19390) `deps` Bump google.golang.org/grpc from 1.82.1 to 1.83.0 - [#19337](influxdata/telegraf#19337) `deps` Bump k8s.io/client-go from 0.36.2 to 0.36.3 - [#19304](influxdata/telegraf#19304) `deps` Bump modernc.org/sqlite from 1.53.0 to 1.54.0 - [#19383](influxdata/telegraf#19383) `deps` Bump modernc.org/sqlite from 1.54.0 to 1.55.0 - [#19378](influxdata/telegraf#19378) `deps` Bump the aws-sdk-go-v2 group with 11 updates - [#19334](influxdata/telegraf#19334) `deps` Bump the aws-sdk-go-v2 group with 11 updates ### Packages Arch | Platform | Package | SHA256 ---| --- | --- | --- arm64 | CentOS | [telegraf-1.39.3-1.aarch64.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.aarch64.rpm) | f2db8ca3b5f8507ecdb1978b83adeaf0f1ff6060326bd8125c1b9221c011ed12 armel | CentOS | [telegraf-1.39.3-1.armel.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.armel.rpm) | fb4d26f2d200e4d84501c7eb07c8d351099605ec67e7322cc2f98b5c62f555a8 armv6hl | CentOS | [telegraf-1.39.3-1.armv6hl.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.armv6hl.rpm) | 5570b28362fb59cfb14615f99695ca57f2612a4cae1e413892b002d0ec2f90cd i386 | CentOS | [telegraf-1.39.3-1.i386.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.i386.rpm) | e9c3ee46b12beab7a01a6b7f1fd5882bf75b064c331db613aab4b8ee37b22d99 unknown | CentOS | [telegraf-1.39.3-1.loongarch64.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.loongarch64.rpm) | 46e348e8719d30eec68d100947da417e5466265e260190fd6edf19dbcf969158 ppc64le | CentOS | [telegraf-1.39.3-1.ppc64le.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.ppc64le.rpm) | c5184a302165ba42e1defb03e9368b983dfb9cf2d51b569add58c7a06c9ecd5d riscv64 | CentOS | [telegraf-1.39.3-1.riscv64.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.riscv64.rpm) | 6051bb8d7a3d26d4b78bc298ee9f14b9911f0a11573bf5a8f9c17a595aec0704 s390x | CentOS | [telegraf-1.39.3-1.s390x.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.s390x.rpm) | 01df6df3746a5ad76a8329c708e35271d9d16e0f1c461e0431d52e0b3d056c70 amd64 | CentOS | [telegraf-1.39.3-1.x86_64.rpm](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3-1.x86_64.rpm) | 61e34743157a77e5d018e7a5b22b8594f4625d498fff298297c337f07f12d21f amd64 | macOS | [telegraf-1.39.3_darwin_amd64.dmg](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_darwin_amd64.dmg) | f8e4d8f81ba7257c1a92da179f03cd2f5b369402005e531983be65b448c3f423 amd64 | macOS | [telegraf-1.39.3_darwin_amd64.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_darwin_amd64.tar.gz) | ab16495f6e127794f93ec715fe4ad8f8177ae396eb23eb1c1cec5e2cddb29bf4 arm64 | macOS | [telegraf-1.39.3_darwin_arm64.dmg](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_darwin_arm64.dmg) | 28cd7e7eae57bd46ffe8c23b6a8914fba562f69825350945addea07a4354b932 arm64 | macOS | [telegraf-1.39.3_darwin_arm64.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_darwin_arm64.tar.gz) | 244ecfe88921ba0b6c8a2139137700bb2faa4041e1c94a7f46c8733d3e51170c amd64 | FreeBSD | [telegraf-1.39.3_freebsd_amd64.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_freebsd_amd64.tar.gz) | 026910d7505995e7618a00e2edc877c95d2b477df5a660f4d1ba66d3c2718bb1 armv7 | FreeBSD | [telegraf-1.39.3_freebsd_armv7.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_freebsd_armv7.tar.gz) | 85b5eeb71e24b35235ea2cefc126698d62e5424f672ae1efa866d60d4f4282b3 i386 | FreeBSD | [telegraf-1.39.3_freebsd_i386.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_freebsd_i386.tar.gz) | edbcab3e336e41c97ce0fad1100bc2a1fa267320ce8816989565d244da467b92 amd64 | Linux | [telegraf-1.39.3_linux_amd64.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_linux_amd64.tar.gz) | 2904d5332a27a1a3f7ccd990139af2e9bc3b393cf5f7c6ac13e26ebc18df1d52 arm64 | Linux | [telegraf-1.39.3_linux_arm64.tar.gz](https://dl.influxdata.com/telegraf/releases/telegraf-1.39.3_linux_arm64.tar.gz) | 516623054b321b851072d021455b3becbeecbe8a2b5582013680d0854a83bc44 armel | Lin See merge request: Harmonybrew/homebrew-core!16321
Summary
Issue #17709 reports occasional long startup times (up to 2 minutes) for Telegraf on some machines. Investigations showed that the time is spent before even reaching main, i.e. the time is spent importing packages. A trace in the issue shows that the culprit is initializing
github.com/testcontainers/testcontainers-go/internal/corewhich, in it'sinit(), iterates over all processes including further processing. On machines with many processes and high load (e.g. during bootup) this may take a while.However, the problematic package should not be there at all as this is clearly testing code.
This PR merges testing code into
filepath_test.goto prevent leakage into the shipped binary, including some cleanup. Checking a trace with this PR applied shows thattestcontainers-gois no longer imported in the binary.Checklist
Related issues
resolves #17709