snowflake-connector-net icon indicating copy to clipboard operation
snowflake-connector-net copied to clipboard

Fix keep alive heartbeat not being initialized correctly

Open alitas opened this issue 2 years ago • 2 comments

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.

alitas avatar Nov 15 '22 16:11 alitas

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Nov 15 '22 16:11 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

alitas avatar Nov 15 '22 16:11 alitas