-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[chore][cmd/configschema] Enable goleak #30492
Conversation
If it's helpful, I can split out the klog v1 to v2 upgrade to a different PR, just let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I am fine with keeping the klog change here if we get an approval from @Aneurysm9 or @pxaws before merging :)
755696a
to
3e1ea0b
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Should we remove the |
- Ignore datadog leaking goroutine, opened issue - Upgrade k8s.io/klog dependency to v2 to avoid leaking goroutine. Relevant link: kubernetes/klog#188
6ab1282
to
1803cf6
Compare
I believe we still need it, as the leak is coming from the opentelemetry-collector-contrib/go.mod Lines 704 to 705 in f69e977
|
Okay, let's wait a week more for @Aneurysm9 or @Pwasx to chime in, if not I can merge this |
**Description:** A lot of leaks were happening in this package because of the extensive list of indirect dependencies. I've filed issues and referenced them for each indirect leak. This PR contains two main changes: 1. Enable `goleak` checks for all tests within `cmd/configschema`. 2. k8s.io/klog v1 has a leaking goroutine that was [resolved in v2](kubernetes/klog#188). I upgraded the dependency in `recevier/awscontainerinsights` to resolve this issue. This is a code change, but is totally internal and no user impact. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#30438 **Testing:** goleak test is passing **Thoughts** 1. Some of these indirect dependencies may never get fixed. For example, one source of a leaking goroutine is [cihub/seelog](https://github.com/cihub/seelog), which hasn't had a commit in 8 years. 2. Indirect dependencies that start goroutines in `init()` are the most common cause. For an example of how indirect it gets, we can look at the dbus leak. ``` crobert$ ~/dev/opentelemetry-collector-contrib/cmd/configschema $ go mod why github.com/godbus/dbus # github.com/godbus/dbus github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema/cfgmetadatagen github.com/open-telemetry/opentelemetry-collector-contrib/internal/components github.com/open-telemetry/opentelemetry-collector-contrib/receiver/snowflakereceiver github.com/snowflakedb/gosnowflake github.com/99designs/keyring github.com/godbus/dbus ``` The bug is in the `99designs/keyring` dependency, and the `goleak` is detected as far back as `cmd/configschema` tests.
**Description:** A lot of leaks were happening in this package because of the extensive list of indirect dependencies. I've filed issues and referenced them for each indirect leak. This PR contains two main changes: 1. Enable `goleak` checks for all tests within `cmd/configschema`. 2. k8s.io/klog v1 has a leaking goroutine that was [resolved in v2](kubernetes/klog#188). I upgraded the dependency in `recevier/awscontainerinsights` to resolve this issue. This is a code change, but is totally internal and no user impact. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#30438 **Testing:** goleak test is passing **Thoughts** 1. Some of these indirect dependencies may never get fixed. For example, one source of a leaking goroutine is [cihub/seelog](https://github.com/cihub/seelog), which hasn't had a commit in 8 years. 2. Indirect dependencies that start goroutines in `init()` are the most common cause. For an example of how indirect it gets, we can look at the dbus leak. ``` crobert$ ~/dev/opentelemetry-collector-contrib/cmd/configschema $ go mod why github.com/godbus/dbus # github.com/godbus/dbus github.com/open-telemetry/opentelemetry-collector-contrib/cmd/configschema/cfgmetadatagen github.com/open-telemetry/opentelemetry-collector-contrib/internal/components github.com/open-telemetry/opentelemetry-collector-contrib/receiver/snowflakereceiver github.com/snowflakedb/gosnowflake github.com/99designs/keyring github.com/godbus/dbus ``` The bug is in the `99designs/keyring` dependency, and the `goleak` is detected as far back as `cmd/configschema` tests.
Description:
A lot of leaks were happening in this package because of the extensive list of indirect dependencies. I've filed issues and referenced them for each indirect leak.
This PR contains two main changes:
goleak
checks for all tests withincmd/configschema
.recevier/awscontainerinsights
to resolve this issue. This is a code change, but is totally internal and no user impact.Link to tracking Issue:
#30438
Testing:
goleak test is passing
Thoughts
init()
are the most common cause. For an example of how indirect it gets, we can look at the dbus leak.The bug is in the
99designs/keyring
dependency, and thegoleak
is detected as far back ascmd/configschema
tests.