Skip to content

fix(common.adx): Make Close safe to call multiple times#18827

Open
skartikey wants to merge 1 commit intoinfluxdata:masterfrom
skartikey:fix-adx-close-idempotent
Open

fix(common.adx): Make Close safe to call multiple times#18827
skartikey wants to merge 1 commit intoinfluxdata:masterfrom
skartikey:fix-adx-close-idempotent

Conversation

@skartikey
Copy link
Copy Markdown
Contributor

Summary

Client.Close() sets adx.client = nil after closing, so a second call would dereference a nil client and panic. This guards the inner Close() call so the method is idempotent.

TestAlreadyClosed is also extended to actually invoke Close() twice, which it didn't before despite its name.

Checklist

Related issues

resolves #

Calling Close twice would dereference a nil client because the previous
call sets adx.client = nil unconditionally. Guard the inner Close call
and extend TestAlreadyClosed to actually invoke Close twice.
@skartikey skartikey self-assigned this Apr 30, 2026
@telegraf-tiger telegraf-tiger Bot added the fix pr to fix corresponding bug label Apr 30, 2026
@telegraf-tiger
Copy link
Copy Markdown
Contributor

@skartikey skartikey added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Apr 30, 2026
@skartikey skartikey removed their assignment Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants