snowflake-jdbc
snowflake-jdbc copied to clipboard
Use sendBatch() instead of sendBatchAsync().get()
In TelemetryClient.close(), sendBatchAsync().get() makes the TelemetryThreadPool do the work and current thread waits for it to complete.
When large number of threads are closing connections concurrently using sendBatchAsync().get()
, the TelemetryThreadPool
gets overloaded (max threads : 10) and this in turn makes SnowflakeConnectionV1.close() a bottleneck.
Instead, sendBatch() can be called directly on the same thread that is closing the connection.
Overview
SNOW-XXXXX
External contributors - please answer these questions before submitting a pull request. Thanks!
Please answer these questions before submitting your pull requests. Thanks!
-
What GitHub issue is this PR adressing? Make sure that there is an accompanying issue to your PR.
Fixes #NNNN
-
Fill out the following pre-review checklist:
- [ ] I am adding a new automated test(s) to verify correctness of my new code
- [ ] I am adding new logging messages
- [ ] I am modyfying authorization mechanisms
- [ ] I am adding new credentials
- [ ] I am modyfying OCSP code
- [ ] I am adding a new dependency
-
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
Pre-review checklist
- [ ] This change has passed precommit
- [ ] I have reviewed code coverage report for my PR in (Sonarqube)
Fixes #665
@Nandakumar-M Please take action on this old PR or close it.