dotnet-db-samples: ORA-50000: Connection request timed out - On Async Operations

Hello every one.

I’m running into a ORA-50000: Connection request timed out when use Async operations on Oracle.ManagedDataAccess.Core Version 23.5.1. o Docker Desktop 4.34.2 (167172) using .Net 8 Image (mcr.microsoft.com/dotnet/aspnet:8.0) and Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.22.0.0.0

My code was based on the example https://github.com/oracle/dotnet-db-samples/blob/master/samples/async/async.cs but without Thread.Sleep(1000); present on line 26

Below is the code I use, just change the parameters User, Password, Host, Database:

 ConnectionString = "User Id=<User>;Password=<Password>;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<Host>)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=<Database>)));";
 using (var connection = new OracleConnection(ConnectionString))
 {
     Task task = connection.OpenAsync();

     using (OracleCommand cmd = new OracleCommand(query, connection))
     {
         await task;
         using (var rdr = await cmd.ExecuteReaderAsync())
         {
             while (await rdr.ReadAsync()) { }
         }
     }
 } 

In stress test scenarios that I wrote in K6, ORA-50000: Connection request timed out is raised. The same does not happen when I use non-asynchronous ones.

k6 script that I use, with the following command: k6 run .\script-orders.js -u 512 -d 60s

import http from 'k6/http';
import { check } from 'k6';

export default function () {
    const url = 'https://localhost:32777/weatherforecast';
  const params = {
    headers: {
      'accept': 'application/json'
      },
  };
  
  const res = http.get(url, params);

  check(res, {
    'status was 200': (r) => r.status === 200,
  });
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 29 (14 by maintainers)

Most upvoted comments

Thanks @WalterDias! We’ll review the trace.

@CavidH We’ll see what the trace has. You can set an Oracle listener connection rate limit if you need to slow down the requests coming into the listener so that the DB is not overwhelmed by connection requests if that is the bottleneck.

Thanks for the support