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

Refresh stage metadata automatically in the background to avoid exceptions encountered during file upload in uploadWithoutConnection #753

Closed
ademfreshbooks opened this issue Apr 22, 2024 · 4 comments

Comments

@ademfreshbooks
Copy link

ademfreshbooks commented Apr 22, 2024

Snowflake Ingest SDK: 2.1.0

For long running clients in streaming mode, It seems ~ every hour, session expires for StreamingIngestStage (used by FlushService), that raises:

Exception encountered during file upload in uploadWithoutConnection

Then StreamingIngestStage retries request again, by default 5 times.

Usually this does the job, however for app observability sake, this is not perfect as this creates false positives.

Also, there does not appear to be any configuration options available to avoid this behaviour, or options to override some of the things.

Can you please try to add auto refresh for stage metadata to avoid this situation?

@sfc-gh-lsembera
Copy link
Contributor

Thanks for the suggestion, @ademfreshbooks. We do attempt to auto-refresh stage metadata when uploads start failing, but we can improve the situation by not logging the initial exception when metadata was immediately successfully refreshed.

@ademfreshbooks
Copy link
Author

ademfreshbooks commented May 8, 2024

Thanks @sfc-gh-lsembera

Upon deeper inspection, it seems the error is being logged in net.snowflake.client.jdbc.SnowflakeFileTransferAgent here before it is being thrown to upper layer.

So it seems Snowflake Ingest SDK is already doing what you say, ie not logging first exception as error as shown here.

What would be your recommendation how to address this behaviour?

It would be ideal to have flag to disable this particular log call...

@sfc-gh-lsembera
Copy link
Contributor

Yeah, the SDK doesn't log the first upload error, but the library we are using to upload data does. Thanks for reporting the issue, we will post updates here once the issue gets prioritized.

sfc-gh-tzhang added a commit that referenced this issue Jul 16, 2024
…eption from JDBC (#780)

We have seen many complains from customer about having false positive ERROR log from JDBC, since we will refresh the token only if it expires. This change switches to actively refresh the token before it expires to avoid the ERROR log.

Refresh stage metadata automatically in the background to avoid exceptions encountered during file upload in uploadWithoutConnection #753

Testing is covered by existing long running end2end test
@sfc-gh-tzhang
Copy link
Contributor

This should be fixed in 2.1.2 release, please give it a try and report back if needed, thanks!

sfc-gh-kgaputis pushed a commit to sfc-gh-kgaputis/snowflake-ingest-java that referenced this issue Sep 12, 2024
…eption from JDBC (snowflakedb#780)

We have seen many complains from customer about having false positive ERROR log from JDBC, since we will refresh the token only if it expires. This change switches to actively refresh the token before it expires to avoid the ERROR log.

Refresh stage metadata automatically in the background to avoid exceptions encountered during file upload in uploadWithoutConnection snowflakedb#753

Testing is covered by existing long running end2end test
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

No branches or pull requests

3 participants