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

Ingest client close() hangs if there is no internet connection #830

Open
aronsemle opened this issue Sep 13, 2024 · 2 comments
Open

Ingest client close() hangs if there is no internet connection #830

aronsemle opened this issue Sep 13, 2024 · 2 comments

Comments

@aronsemle
Copy link

aronsemle commented Sep 13, 2024

If you create a SnowflakeStreamingIngestClient and then a channel and start sending data, then "pull the chord" or kill your internet and then try and clean up, the SnowflakeStreamingIngestClient.close() call hangs.

       // Close all channels
        if (this.outputChannels != null) {
            for (var channel : this.outputChannels.entrySet()) {
                try {
                    channel.getValue().close();
                } catch (Exception ignored) {
                }
            }
            this.outputChannels.clear();
        }

        // Close the client
        if (this.streamClient != null) {
            try {
                if (!this.streamClient.isClosed()) {
                    // This appears to hang indefinitely. As soon as I recover internet it works
                    this.streamClient.close();
             |
            } catch (Exception ignored) {
            }

            this.streamClient = null;
        }
@aronsemle
Copy link
Author

For a little more background, we're on a local network pushing to Snowflake. In the case of an error (cable pull or other) we generally disconnect and tear down all resources and reconnect to start a "fresh" connection.

@aronsemle
Copy link
Author

I think the bug is in SnowflakeStreamingIngestClientInternal.close(). It calls this.flush(true).get() which appears to never return? It seems like this should be this.flush(true).get(10, TimeUnit.SECONDS); or something with a reasonable wait time?

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

1 participant