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

SNOW-996732: improve clean up logic of connection #1898

Conversation

sfc-gh-aling
Copy link
Collaborator

@sfc-gh-aling sfc-gh-aling commented Mar 7, 2024

Please answer these questions before submitting your pull requests. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

the __del__ method is unstable and gets called at random timing.
in one of the recent report, we found the __del__ is causing circular import issue.

as a short term fix, we fix by moving away from __del__ method to using atexit to clean up connection at intepreter shutdown time.

long term fix plan here: SNOW-1218851

  1. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  2. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

@sfc-gh-aling sfc-gh-aling marked this pull request as ready for review March 7, 2024 03:17
@sfc-gh-bwarsaw
Copy link
Contributor

As mentioned in Slack: One thing to keep in mind is that atexit handlers don't get run if os._exit() is called or the process crashes.

@sfc-gh-aling
Copy link
Collaborator Author

thanks @sfc-gh-bwarsaw , this should not be a concern to our connector as we didn't perform critical job during the closing stage.

…ke-ocsp-asn-1-crypto-from-partially-initialized-module
@sfc-gh-aling sfc-gh-aling enabled auto-merge (squash) March 14, 2024 18:58
…ke-ocsp-asn-1-crypto-from-partially-initialized-module
@sfc-gh-aling sfc-gh-aling merged commit 23eda6e into main Mar 14, 2024
90 checks passed
@sfc-gh-aling sfc-gh-aling deleted the SNOW-996732-error-cannot-import-name-snowflake-ocsp-asn-1-crypto-from-partially-initialized-module branch March 14, 2024 22:12
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants