Problem: When the server side socket closes due to the network issues, redshift-connector raises an unpack_from error that is confusing and misleading to users.
Now, when the server side socket closes due to network issues, redshift-connector will raise the error suggesting users to double check their client-side networking configurations, and if they set a timeout for their connection, will ask them to raise it or use None as default.
The fix address this issue. (due to network issues)
Testing
Wrote unit and integration tests.
Ran manual tests using default timeout and manually setting timeout:
conn = redshift_connector.connect(dbkwargs)
cursor = conn.cursor()
try:
for i in range(100):
print(f"Connection is open. Waiting... {i} round")
time.sleep(33)
cursor.execute("select * from svv_all_columns")
time.sleep(17)
except Exception as e:
raise e
finally:
cursor.close()
Screenshots (if appropriate)
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
Checklist
[x] Local run of ./build.sh succeeds
[x] Code changes have been run against the repository's pre-commit hooks
Description
Motivation and Context
Problem: When the server side socket closes due to the network issues, redshift-connector raises an unpack_from error that is confusing and misleading to users. Now, when the server side socket closes due to network issues, redshift-connector will raise the error suggesting users to double check their client-side networking configurations, and if they set a timeout for their connection, will ask them to raise it or use None as default.
The fix address this issue. (due to network issues)
Testing
Wrote unit and integration tests. Ran manual tests using default timeout and manually setting timeout:
Deterministic example:
Nondeterministic example:
Screenshots (if appropriate)
Types of changes
Checklist
./build.sh
succeedspytest test/unit
and they are passing.