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

SharePoint Online Connector: Added credentials.close() call to _fetch_token() method #3177

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

mattnowzari
Copy link
Contributor

@mattnowzari mattnowzari commented Feb 4, 2025

Closes https://github.com/elastic/search-team/issues/9195

This fixes an issue where Unclosed client session and Unclosed connector messages were appearing in logs.

RCA:
aiohttp does not close its sessions, so when we create an Azure CertificateCredential, we need to manually call .close() on it, otherwise the client sessions will remain open.

See this Azure Python SDK thread for details.

Checklists

Pre-Review Checklist

  • this PR does NOT contain credentials of any kind, such as API keys or username/passwords (double check config.yml.example)
  • this PR has a meaningful title
  • this PR links to all relevant github issues that it fixes or partially addresses
  • this PR has a thorough description
  • Covered the changes with automated tests
  • Tested the changes locally
  • Added a label for each target release version (example: v7.13.2, v7.14.0, v8.0.0)

@mattnowzari mattnowzari added the bug Something isn't working label Feb 4, 2025
@mattnowzari mattnowzari marked this pull request as ready for review February 4, 2025 21:03
@mattnowzari mattnowzari requested a review from a team as a code owner February 4, 2025 21:03
Copy link
Member

@jedrazb jedrazb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just double checking: did you manage to reproduce the bug and verify that it fixes it locally?

@mattnowzari
Copy link
Contributor Author

@jedrazb yup, I was! Artem helped me repro the bug when I couldn't figure it out, there is a slack thread here --> https://elastic.slack.com/archives/C01795T48LQ/p1738351743527109

@mattnowzari mattnowzari merged commit 56b6971 into main Feb 5, 2025
3 checks passed
@mattnowzari mattnowzari deleted the fix_spo_connector_unclosed_session_warning branch February 5, 2025 13:23
github-actions bot pushed a commit that referenced this pull request Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

💚 Backport PR(s) successfully created

Status Branch Result
9.0 #3179

This backport PR will be merged automatically after passing CI.

mattnowzari added a commit that referenced this pull request Feb 5, 2025
@artem-shelkovnikov
Copy link
Member

@mattnowzari I think this should be backported farther than 9.0, original PR was backported up to 8.16.x: #3064

@mattnowzari
Copy link
Contributor Author

@artem-shelkovnikov sounds good! Was not aware of the original PR and how far it had been backported, will backport to every version #3064 was ported to

@mattnowzari
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x
8.18
8.17
8.16

Questions ?

Please refer to the Backport tool documentation

mattnowzari added a commit that referenced this pull request Feb 5, 2025
mattnowzari added a commit that referenced this pull request Feb 5, 2025
mattnowzari added a commit that referenced this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants