-
Notifications
You must be signed in to change notification settings - Fork 74
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
IAM authentication leads to unclosed socket warning #100
Comments
Hi @Tradunsky , this is an interesting issue. The redshift-connector method mentioned in the trace,
I haven't seen this error before when running on my local machine or our CI infrastructure, but will try to use your repro and give an update here. Are you seeing this issue reproducing consistently? And just to clarify, is the code block you posted under |
I am able to reproduce after adding the following at the top of the
I looked around a bit and found this issue open with boto3, which looks like where the warning is originating from. As I said earlier, redshift-connector doesn't directly open any sockets in the mentioned block of code, set_cluster_credentials, we invoke boto3 which appears to be doing so. Unfortunately we cannot suppress warnings from libraries redshift-connector uses, but the mentioned issue above gives a good overview of why this message shows up as well as some different thoughts on it. Please let me know if you have any other questions or need clarification |
Hi @Brooke-white, Sorry for the late reply, was away from the keyboard for some time. Thank you very much for the reference! I have read some workarounds, like suppressing the warning and also spent a decent amount of time debugging redshift connector itself, before submission of this issue, but I have not realized the depth of the issue actually related to boto3 and not the usage of boto3 by readshift connector. Thank you for pointing this out! However, according to the most likely solution boto3 maintainers accept boto/botocore#1810 (of course after some analysis) do you think redshift connector maintainers should make a change in the connector to prevent this memory leak from happening? |
Hey @Tradunsky , thanks for following up. We can monitor the referenced solution, and if merged, take steps to apply to redshift_connector as well. |
this response on the issue gives some context to the cause of the warning, and tradeoffs of the PRs that have been posted to resolve this. |
Driver version
^2.0.907
Redshift version
' version
'PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.38094��'
Client Operating System
Darwin Kernel Version 20.6.0
Python version
3.7, 3.9
Table schema
Problem description
Execution of a simple sample leads to unclosed socket warning:
There is no such error when setting
iam=False
.Python Driver trace logs
Reproduction code
The text was updated successfully, but these errors were encountered: