Skip to content
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

Fix activedirectorydsreceiver=shutdown #16

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Receiver must not panic on Shutdown
  • Loading branch information
pjanotti committed Nov 26, 2023
commit 80285596c899a2286babc05b9ac9d6cb60b5a8e7
2 changes: 1 addition & 1 deletion receiver/activedirectorydsreceiver/counters.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (w *watchers) Scrape(name string) (float64, error) {
}

func (w *watchers) Close() error {
if w.closed {
if w == nil || w.closed {
return nil
}

Expand Down
4 changes: 4 additions & 0 deletions receiver/activedirectorydsreceiver/factory_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,9 @@ func TestCreateMetricsReceiver(t *testing.T) {

require.NoError(t, err)
require.NotNil(t, recv)

// The receiver must be able to shutdown cleanly without a Start call.
err = recv.Shutdown(context.Background())
require.NoError(t, err)
})
}