From 37e015b4826b5ad7cc168666bb9eb944cfe448d5 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Fri, 24 Nov 2017 01:45:56 +0000 Subject: [PATCH] Only return an executor to the pool once The executor was being returned to the pool twice, which was resulting in nil interface{} errors when creating new executors concurrently, as the transaction would not be set properly. --- db/db.go | 2 -- db/executor.go | 7 ------- 2 files changed, 9 deletions(-) diff --git a/db/db.go b/db/db.go index 19af83da..50d993bc 100644 --- a/db/db.go +++ b/db/db.go @@ -223,8 +223,6 @@ func Process(fib *fibre.Context, ast *sql.Query, vars map[string]interface{}) (o executor := newExecutor() - defer executor.reset() - go executor.execute(ctx, ast) // Wait for all of the processed queries to diff --git a/db/executor.go b/db/executor.go index 70565139..ea38f91c 100644 --- a/db/executor.go +++ b/db/executor.go @@ -47,13 +47,6 @@ func newExecutor() (e *executor) { } -func (e *executor) reset() { - - e.send = nil - executorPool.Put(e) - -} - func (e *executor) execute(ctx context.Context, ast *sql.Query) { var err error