From 0b0b0995f3f452c4337d1cf2266524a631ddad80 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Tue, 8 Oct 2024 15:07:30 -0400 Subject: [PATCH] Work Signed-off-by: Cole Miller --- src/gateway.c | 1 + src/leader.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gateway.c b/src/gateway.c index ec9e92ea4..1e404a233 100644 --- a/src/gateway.c +++ b/src/gateway.c @@ -718,6 +718,7 @@ static void handle_exec_sql_next(struct gateway *g, static void handle_exec_sql_cb(struct exec *exec, int status) { tracef("handle exec sql cb status %d", status); + fprintf(stderr, "[INFO FOR COLE] handle exec sql cb %p %d finalizing\n", exec->stmt, status); struct gateway *g = exec->data; struct handle *req = g->req; diff --git a/src/leader.c b/src/leader.c index 30b1ba222..bca78d60f 100644 --- a/src/leader.c +++ b/src/leader.c @@ -192,6 +192,8 @@ void leader__close(struct leader *l) assert(l->inflight == NULL); l->exec->status = SQLITE_ERROR; exec_done(l->exec, 0); + } else { + fprintf(stderr, "[INFO FOR COLE] leader close nothing happening\n"); } rc = sqlite3_close(l->conn); if (rc != SQLITE_OK) { @@ -457,10 +459,14 @@ static void exec_done(struct exec *req, int asyncness) } sm_fini(&req->sm); req->leader->exec = NULL; - if (req->cb != NULL && asyncness == 0) { - req->cb(req, status); + fprintf(stderr, "[INFO FOR COLE] exec_done clearing %p\n", req->stmt); + if (req->cb == NULL) { + fprintf(stderr, "[INFO FOR COLE] skip callback for %p because cb is NULL\n", req->stmt); } else if (asyncness != 0) { fprintf(stderr, "[INFO FOR COLE] skip callback for %p because asyncness is %d\n", req->stmt, asyncness); + } else { + fprintf(stderr, "[INFO FOR COLE] invoke callback for %p\n", req->stmt); + req->cb(req, status); } }