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

Snow 1944643 network errors retry #1015

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

Conversation

sfc-gh-pmotacki
Copy link
Collaborator

Description

Please explain the changes you made here.

Checklist

  • Format code according to the existing code style (run npm run lint:check -- CHANGED_FILES and fix problems in changed code)
  • Create tests which fail without the change (if possible)
  • Make all tests (unit and integration) pass (npm run test:unit and npm run test:integration)
  • Extend the types in index.d.ts file (if necessary)
  • Extend the README / documentation and ensure is properly displayed (if necessary)
  • Provide JIRA issue id (if possible) or GitHub issue id in commit message

@sfc-gh-pmotacki sfc-gh-pmotacki requested a review from a team as a code owner February 24, 2025 14:31
@@ -18,7 +18,7 @@ export DRIVER_NAME=nodejs
BUILD_IMAGE_VERSION=1

# Test Images
TEST_IMAGE_VERSION=1
TEST_IMAGE_VERSION=2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this? We can update existing image and Jenkins always downloads fresh one.

RUN pip install -U snowflake-connector-python

ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
ENV PATH="$PATH:/usr/lib/jvm/java-17-openjdk/bin"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you install via APK it is not automatically updated?

@@ -468,6 +468,10 @@ exports.isRetryableHttpError = function (response, retry403) {
(response.statusCode === 429));
};

exports.isNetworkError = function (err) {
return err.code === Errors.codes.ERR_SF_NETWORK_COULD_NOT_CONNECT;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean only when we can't connect? Is it the customer problem or maybe it was more like resets?

await wireMock.global.shutdown();
});
it('Test retries - Connection reset', async function () {
// snowflake.configure({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove?

// logLevel: "DEBUG",
// disableOCSPChecks: true
// });
await addWireMockMappingsFromFile(wireMock, 'wiremock/mappings/six_reset_connection_and_correct_response.json');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based only on mapping file name - should we also have a test, when it eventually ends up in connection reset propagated to the user?

const os = require('os');
const testUtil = require('../testUtil');

if (os.platform !== 'win32') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a test for wiremock itself? Do we still need this?


const timeout = new Promise((resolve, reject) =>
timeoutHandle = setTimeout(
() => reject('Wiremock unavailable after 60s.'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wiremock gets up in a second, maybe we can lower this limit?

}
},
{
"scenarioName": "Heartbeat",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth adding it by default to wiremock instead of adding it in each test?

@@ -0,0 +1,34 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed?

Comment on lines 1001 to +1014
name: PARAM_RETRY_SF_MAX_NUM_RETRIES,
defaultValue: 1000,
external: true,
validate: isNonNegativeInteger
},
{
name: PARAM_RETRY_SF_STARTING_SLEEP_TIME,
defaultValue: 1,
external: true,
validate: isNonNegativeNumber
},
{
name: PARAM_RETRY_SF_MAX_SLEEP_TIME,
external: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since now PARAM_RETRY_SF_MAX_NUM_RETRIES , PARAM_RETRY_SF_STARTING_SLEEP_TIME, and PARAM_RETRY_SF_MAX_SLEEP_TIME will be public, my respectful request here would be that please make sure the parameters are correctly documented in Snowflake docs. Thank you in advance! 🙇

@sfc-gh-pmotacki sfc-gh-pmotacki force-pushed the SNOW-1944643-network-errors-retry branch from 849333f to 5df04d5 Compare March 4, 2025 08:52
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.

3 participants