Skip to content

Commit 546d907

Browse files
authored
dyninst/module: reorder shutdown a tad (#43366)
### What does this PR do? Shuts down the uploaders after we stop using them. ### Motivation I didn't like seeing: ``` w 04:16:41.279027655 @/git/datadog-agent/pkg/dyninst/uploader/logs.go:155| closing a tagged uploader (logs:1) that is not in the factory: metadata={tags: "", entityID: "", containerID: ""} ``` Perhaps a better change would be to, well, notice that the factory is shut down and not emit such a warning, but it doesn't quite seem worth it. ### Describe how you validated your changes Noticed improvements in the test output. Co-authored-by: andrew.werner <andrew.werner@datadoghq.com>
1 parent 70ee310 commit 546d907

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pkg/dyninst/module/module.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,6 @@ func (c *realDependencies) asDependencies() dependencies {
165165
}
166166

167167
func (c *realDependencies) shutdown() {
168-
if c.logUploader != nil {
169-
c.logUploader.Stop()
170-
}
171-
if c.diagsUploader != nil {
172-
c.diagsUploader.Stop()
173-
}
174168
if c.actuator != nil {
175169
if err := c.actuator.Shutdown(); err != nil {
176170
log.Warnf("error shutting down actuator: %v", err)
@@ -184,6 +178,12 @@ func (c *realDependencies) shutdown() {
184178
if c.loader != nil {
185179
c.loader.Close()
186180
}
181+
if c.logUploader != nil {
182+
c.logUploader.Stop()
183+
}
184+
if c.diagsUploader != nil {
185+
c.diagsUploader.Stop()
186+
}
187187
if c.symdbManager != nil {
188188
c.symdbManager.stop()
189189
}

0 commit comments

Comments
 (0)