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

[Connection pool] skip heartbeat check in keep-alive mode #279

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

datbth
Copy link

@datbth datbth commented Mar 21, 2022

Summary

In connection pool, skip heartbeat check when keep-alive is enabled.

Description

  • Before:
    • Every acquire() call on the connection pool runs a heartbeat query (given that testOnBorrow of the pool is kept as true)
      • One big purpose of a connection pool is to avoid the overhead of the initial connection step. However, this heartbeat query execution results in an equivalent or even higher overhead, especially when the heartbeat query fails and the pool has to make a new connection.
  • After:
    • When clientSessionKeepAlive is true, skip the heartbeat query check and check only the client-side connection status.

Other changes

  • Refactor heartbeatAsync into checkHeartbeat:
    • When the heartbeat query fails, resolve the returned Promise into false instead of raising an Error.
    • Reuse the function heartbeat to reduce code duplication and ensure the consistency of "heartbeat" queries.
  • Check client-side connection status first (i.e. short-circuiting the logic) to avoid unnecessary heartbeat query executions.

@github-actions
Copy link

github-actions bot commented Mar 21, 2022

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

@datbth
Copy link
Author

datbth commented Mar 21, 2022

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

SimbaGithub pushed a commit that referenced this pull request May 2, 2023
sfc-gh-ext-simba-dl added a commit that referenced this pull request May 26, 2023
… return statement issue. (#492)

* fixing performance issue on array binding #217 and execute does not return statement #279

* adding test case for issue 279

* use reject instead of throw

* added isStageCreated logic to prevent create stage more than once.

* revert back transferAccelerateConfig function

* remove promise, and able to return statement

* adding statement output from stage binding

* rename stage binding request function

* adding force stage bind error and testcase

* added cancel testcase.

* add cancel test case for stage binding

* add delete stage for stage binding with cancel test case

* force create stage error on stage binding test with cancel

* reduce the customer table size for Mac

* fix missing await, then the upload file always return 0 target size
jportner pushed a commit to jportner/snowflake-connector-nodejs that referenced this pull request Jun 5, 2023
… return statement issue. (snowflakedb#492)

* fixing performance issue on array binding snowflakedb#217 and execute does not return statement snowflakedb#279

* adding test case for issue 279

* use reject instead of throw

* added isStageCreated logic to prevent create stage more than once.

* revert back transferAccelerateConfig function

* remove promise, and able to return statement

* adding statement output from stage binding

* rename stage binding request function

* adding force stage bind error and testcase

* added cancel testcase.

* add cancel test case for stage binding

* add delete stage for stage binding with cancel test case

* force create stage error on stage binding test with cancel

* reduce the customer table size for Mac

* fix missing await, then the upload file always return 0 target size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant