-
Notifications
You must be signed in to change notification settings - Fork 141
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-1276398: OpenAsync does not throw an exception in case of timeout #900
Comments
hi and thank you for raising this with us. So I'm trying to reproduce the problem using .NET Core 6.0 (which is supported by the driver) and Snowflake.Data v3.0.0 and this repro program: using System.Data.Common;
using Snowflake.Data.Client;
class Program
{
static async Task Main(string[] args)
{
string connectionString = "account=myaccount.eu-central-1; " +
" user=admin; password=password; role=ACCOUNTADMIN;" +
" DB=TEST_DB; warehouse=COMPUTE_WH;" +
" useproxy=true;proxyhost=no.such.pro.xy;proxyport=8080";
try
{
await ConnectToSnowflakeAsync(connectionString);
}
catch (Exception ex)
{
Console.WriteLine($"Error connecting to Snowflake: {ex.Message}");
}
}
static async Task ConnectToSnowflakeAsync(string connectionString)
{
using (var connection = new SnowflakeDbConnection())
{
connection.ConnectionString = connectionString;
await connection.OpenAsync().ConfigureAwait(false);
Console.WriteLine("Connected to Snowflake!");
await ExecuteQueryAsync(connection, "SELECT current_timestamp()");
await connection.CloseAsync();
}
}
static async Task ExecuteQueryAsync(DbConnection connection, string query)
{
using (var command = connection.CreateCommand())
{
command.CommandText = query;
using (var reader = await command.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
{
Console.WriteLine($"Current Timestamp: {reader[0]}");
}
}
}
}
} and what I'm seeing after running the program, that it gets hung for ~1.5 minutes, then bails out with
so I could not get to the 'no exception is thrown' ; i'm getting an error after all. Without the non-existing proxy part, the query is successfully run. if you're seeing something different, could you please provide us with a minimal viable and runnable code which when run, leads to the issue you're experiencing? |
You actually did, the exception is thrown by |
ah - you're right. Got you now. We'll take a look - thanks for drawing our attention to this one ! |
@sfc-gh-dszmolka Hi, any ETA for the resolution of this issue? |
hey - no fixed ETA known at this moment but i'm syncing internally on this one and will update this thread once I got any estimated delivery. (to set the expectations: the very earliest possible is at the end of this month with the April release cycle, if we fall outside of that, then in the May release cycle) will post the further details once known - thank you for bearing with us ! |
Thanks. |
the supported way of specifying the proxy is to use USEPROXY & co. as described in the README, specified in the connection string. I never tested with the system-wide envvars like |
I don't think these environment variables are taken into account but it seems like even when I specify a proxy manually, my WinInet configuration is used. |
if you wish to discuss this second topic (on the proxy) further or even suspect there is a bug, could you please raise a separate Issue for it ? Seems a bit unrelated to the original issue which revolves around how |
You're right, thanks |
We also got this issue and can't debug it, since we can't figure out why the connection failed to open... We do get exception when trying to execute a query, but that one is expected (trying to run a query on a closed connection). Has this been addressed so far or is this still an open issue? |
hi @mbfis , folks, yes indeed this is still an open issue and at this moment unfortunately I don't have a timeline for fix implementation; only that there's someone from the team working on it. As with every other issue in every other Snowflake driver repository, I'm updating this one as well as soon as there is any new information. To troubleshoot a particular connectivity issue, I can give it a stab if you can please open a new Issue here (to keep things consistent; because this Issue is tracking the behavour of OpenAsync) - or if you're not comfortable sharing connection details, logs here, then please open a case with Snowflake Support. to work 1:1 with a support engineer. Thank you ! |
PR under review #999 |
released with v4.1.0 of the Snowflake .NET driver |
What version of .NET driver are you using?
3.0.0
What operating system and processor architecture are you using?
Windows Server 2019 X64
What version of .NET framework are you using?
.net8
What did you do?
In the connection string, if a proxy is specified but cannot be reached,
OpenAsync
times out (as expected) but no exception is thrown resulting in a connection whichState
isClosed
.What did you expect to see?
An exception should be raised in case the connection cannot be opened.
Can you set logging to DEBUG and collect the logs?
Not relevant.
What is your Snowflake account identifier, if any? (Optional)
The text was updated successfully, but these errors were encountered: