Teradata.Client.Provider 16.20.1 connection issue

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.

Teradata.Client.Provider 16.20.1 connection issue

I recently upgraded my .net 4.7.2 solution from Teradata.Net.Data.Provider 15.11.01 to Teradata.Client.Provider 16.20.1. Now I get a lot of [100002] timeout connection errors. Out of 100, I will get it 13 timeouts. If I downgrade to 15.11.01 then all goes well and I am able to connect 100 out of 100. 

I've been running on 15.11.01 for the past year generating ~ 1K + connections per day without ever getting one connection timeout error, but since I ported to 16.20.1 I am getting tons of errors.

I tried on 4 hosts including 2 servers, across various networks. I also tried setting the connection timeout to 90 seconds with no avail. 

8 REPLIES 8

Re: Teradata.Client.Provider 16.20.1 connection issue

I tried setting connection timeout property to 0 with Connection Timeout=0; in the connection string, however it is still timing out after roughly what it seems 8-10 seconds. Even if I set it to 6000 seconds, it will be ok for a few connections and then suddenly it waits for a connection for 10 seconds so and then I get exception.

Re: Teradata.Client.Provider 16.20.1 connection issue

Any updates anyone? It's been months and it's still happening. No possibility to update to 16.20

Fan

Re: Teradata.Client.Provider 16.20.1 connection issue

Thanks for your post!

I have the same issue and it's still present in 16.20.5.

Can someone at Teradata please look into this?

 

Best regards,

Kaarew

Teradata Employee

Re: Teradata.Client.Provider 16.20.1 connection issue

I also have the same issue with Teradata.Client.Provider 16.20.4.0

 

Is there any solution to it? Can version downgrading of Teradata.Client.Provider solve the problem?


@Kaarew wrote:

Thanks for your post!

I have the same issue and it's still present in 16.20.5.

Can someone at Teradata please look into this?

 

Best regards,

Kaarew


 

Teradata Employee

Re: Teradata.Client.Provider 16.20.1 connection issue

@KaarewPlease open an incident with Teradata support. They may want a .NET trace or other supporting information to help identify the cause.

Teradata Employee

Re: Teradata.Client.Provider 16.20.1 connection issue

The default maximum number of sessions a user can have is 100 in Teradata.Client.Provider 16.20.1. 

The solution is to increase the default number of sessions.


@mohtashim wrote:

I also have the same issue with Teradata.Client.Provider 16.20.4.0

 

Is there any solution to it? Can version downgrading of Teradata.Client.Provider solve the problem?


@Kaarew wrote:

Thanks for your post!

I have the same issue and it's still present in 16.20.5.

Can someone at Teradata please look into this?

 

Best regards,

Kaarew


 


 

Fan

Re: Teradata.Client.Provider 16.20.1 connection issue

I don't think this is related to the number sessions, but to some timeout issue. Others have observed 8-10 seconds. This corresponds to my observations.

 

To demonstrate the issue I've made a little console app in Visual Studio.
Just create a console app, replace the Program.cs with this code and supply a valid connection string.

You also have to add the Teradata NuGet package.

 

using System;
using System.Threading.Tasks;
using Teradata.Client.Provider;

namespace TdConnectionTimeout
{
    class Program
    {
        static void Main(string[] args)
        {
            RunTest();
            Console.ReadKey();
        }

        private static DateTime _start;

        private static void Log(string s)
        {
            Console.WriteLine("[" + (DateTime.Now - _start).ToString(@"hh\:mm\:ss") + "] " + s);
        }

        private static async void RunTest()
        {
            Console.WriteLine("Teradata v" + typeof(Teradata.Client.Provider.TdConnection).Assembly.GetName().Version);

            string conStr = "Data Source=***;Database=***;User Id=***;Password=***;Connection Timeout=30;Connection Pooling=True;Min Pool Size=0;Max Pool Size=1";
            Console.WriteLine("ConnectionString: " + conStr);

            _start = DateTime.Now;
            int i = 0;
            while ((DateTime.Now - _start).TotalSeconds < 60)
            {
                i++;
                try
                {
                    bool ok = await OpenTeradataAsync(conStr);
                }
                catch (Exception ex)
                {
                    Log("[i=" + i + "] " + ex.Message);
                }
            }

            Log("Test run complete.");
        }

        private static async Task<bool> OpenTeradataAsync(string conStr)
        {
            using (TdConnection conn = new TdConnection(conStr))
            {
                await conn.OpenAsync();     // Open the connection asynchronously
                conn.Close();               // Does not matter.
            }
            return true;
        }
    }
}

A typical run looks like this:

Teradata v16.20.5.0
ConnectionString: Data Source=***;Database=***;User Id=***;Password=***;Connection Timeout=30;Connection Pooling=True;Min Pool Size=0;Max Pool Size=1
[00:00:08] [i=169] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:00:16] [i=340] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:00:24] [i=501] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:00:32] [i=662] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:00:40] [i=833] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:00:48] [i=1006] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:00:56] [i=1147] [.NET Data Provider for Teradata] [100002] Cannot create connection within the time specified.
[00:01:00] Test run complete.

As you can see the errors occur pretty regularly, with approx. 8 seconds in between.

You have to turn on connection pooling and use the OpenAsync() method, as shown in my example. Increasing the Max pool size does not have any effect.

Downgrading to 15.11.1.0 works, but I'd rather avoid that:

Teradata v15.11.1.0
ConnectionString: Data Source=***;Database=***;User Id=***;Password=***;Connection Timeout=30;Connection Pooling=True;Min Pool Size=0;Max Pool Size=1
[00:01:00] Test run complete.

 

I hope this can help you pinpoint this error.

 

Best regards,

Kaarew

 

Highlighted
Teradata Employee

Re: Teradata.Client.Provider 16.20.1 connection issue

Please upgrade to .NET Data Provider for Teradata 16.20.7 available from Nuget.org; and also stop using the earlier versions. Ealier versions close the connection in 2 to 10 seconds when Connection-Pooling is enabled and TdConnection.OpenAsync is used to retrieve an idle connection from the pool.