mortenbra/thoth-gateway

Oracle connections are not closing when a bad request(404) is returned

Closed this issue · 4 comments

When a request results in a 404 error, the Oracle database connection is left open. If too many requests are made then Thoth can no longer service valid requests because it fails to get a connection from the pool(after the default of 100 connections are made).

2021-03-24 10:49:11,913 [64] ERROR PLSQLGatewayModule.PLSQLHttpModule Failed to connect to database: Pooled connection request timed out

We see this in the code :
// TODO: does this get called if HttpException is thrown above... don't think so!
ora.CloseConnection();

This became a problem for us when a vulnerability scan was done on one of our sites using Thoth. The tool made many requests which required an application pool restart.

About time to fix that TODO :-)

Fixed in upcoming v1.4.5 release.

Hello! Any plans to release the upcoming v1.4.5 release?

@UncleJohnWellit Waiting to see if a new gateway release is required to work with Database 23ai (Free/Enterprise), in which case the improvement mentioned here will be rolled into that release.