snowflake-connector-net
snowflake-connector-net copied to clipboard
Fix keep alive heartbeat not being initialized correctly
The current implementation tries to start the heartbeat before auth response is received, which causes either a null pointer exception or a 401 response depending on the timing of the network. Furthermore, because of the singleton pattern, the heartbeat thread never stops, using system resources unnecessarily.
Instead of using token validity in seconds, this PR uses CLIENT_SESSION_KEEP_ALIVE_HEARTBEAT_FREQUENCY, which is returned by the server upon setting CLIENT_SESSION_KEEP_ALIVE true. It also allows overriding this parameter.
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA