You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/02/01 20:45:16 UTC

[incubator-trafficcontrol] branch master updated: prepared transactions from within a handler create a connections leak to postgres

This is an automated email from the ASF dual-hosted git repository.

dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 4e1f2d9  prepared transactions from within a handler create a connections leak to postgres
4e1f2d9 is described below

commit 4e1f2d927b909cc2fc79db8c3b25b8fc11a1b59d
Author: Dylan Volz <Dy...@comcast.com>
AuthorDate: Mon Jan 29 10:31:00 2018 -0700

    prepared transactions from within a handler create a connections leak to postgres
---
 traffic_ops/traffic_ops_golang/tenant/tenancy.go | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/traffic_ops/traffic_ops_golang/tenant/tenancy.go b/traffic_ops/traffic_ops_golang/tenant/tenancy.go
index 0a71ef0..13a8899 100644
--- a/traffic_ops/traffic_ops_golang/tenant/tenancy.go
+++ b/traffic_ops/traffic_ops_golang/tenant/tenancy.go
@@ -45,13 +45,9 @@ func (dsInfo DeliveryServiceTenantInfo) IsTenantAuthorized(user auth.CurrentUser
 // returns tenant information for a deliveryservice
 func GetDeliveryServiceTenantInfo(xmlId string, db *sqlx.DB) (*DeliveryServiceTenantInfo, error) {
 	ds := DeliveryServiceTenantInfo{}
-	tenantInfoStmt, err := db.Preparex("SELECT xml_id,tenant_id FROM deliveryservice where xml_id = $1")
-	if err != nil {
-		log.Errorf("deliveryservice sql query error, xmlId '%s': %v\n", xmlId, err)
-		return nil, err
-	}
+	query := "SELECT xml_id,tenant_id FROM deliveryservice where xml_id = $1"
 
-	err = tenantInfoStmt.Get(&ds, xmlId)
+	err := db.Get(&ds,query,xmlId)
 	switch {
 	case err == sql.ErrNoRows:
 		ds = DeliveryServiceTenantInfo{}

-- 
To stop receiving notification emails like this one, please contact
dangogh@apache.org.