]> granicus.if.org Git - pgbouncer/commitdiff
dont Assert() on query_start=0
authorMarko Kreen <markokr@gmail.com>
Fri, 17 Aug 2007 20:29:40 +0000 (20:29 +0000)
committerMarko Kreen <markokr@gmail.com>
Fri, 17 Aug 2007 20:29:40 +0000 (20:29 +0000)
src/server.c

index 479ee93ef883b22b5d615a0c76c2aff93850ca47..70169d5b7e2a839ceb88db39fd4581f1c8bdf415 100644 (file)
@@ -220,14 +220,14 @@ static bool handle_server_work(PgSocket *server, PktHdr *pkt)
                sbuf_prepare_skip(sbuf, pkt->len);
        } else if (client) {
                sbuf_prepare_send(sbuf, &client->sbuf, pkt->len);
-               if (ready) {
+               if (ready && client->query_start) {
                        usec_t total;
-                       Assert(client->query_start != 0);
-                       
                        total = get_cached_time() - client->query_start;
                        client->query_start = 0;
                        server->pool->stats.query_time += total;
                        slog_debug(client, "query time: %d us", (int)total);
+               } else if (ready) {
+                       slog_warning(client, "FIXME: query end, but query_start == 0");
                }
        } else {
                if (server->state != SV_TESTED)