Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK6mw-0004m8-Bi for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Nov 2017 18:08:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK6mv-00052t-2R for pgsql-bugs@arkaria.postgresql.org; Wed, 29 Nov 2017 18:08:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eK6mu-00052j-NU for pgsql-bugs@lists.postgresql.org; Wed, 29 Nov 2017 18:08:48 +0000 Received: from synchrony.wurm.cx ([192.155.92.72]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eK6mo-0007db-8r for pgsql-bugs@postgresql.org; Wed, 29 Nov 2017 18:08:45 +0000 Received: from localhost (localhost [127.0.0.1]) by synchrony.wurm.cx (Postfix) with ESMTP id D37435406B for ; Wed, 29 Nov 2017 12:01:02 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=skarsol.com; s=synchrony; t=1511978462; bh=LN5UYsC1N6UvhCdwp6ESQDP8RAPUiWTxCAmRjk7VcyE=; h=Date:From:To:Subject; b=k9tYQgtsXIz1oOuEFI9T4mb3bVNMJwS4B9Tk6HPIrRPJzL5v6aLqwLZeWMQiqpOEy nv5ZwlBZgK6tWss+0Zo2Qv0c+YjCk/ZuNYSLAejJIaKb6HBYwYoUyASoCqctnNIA+6 s/Im4ZT04x8js51L1ErK+CZ7231Z8MYcQv48hcCXo+t4pvSB7/GSnWi7mu3bc+4Fk1 0+gTIR4qJof4ZVkcNKSVBdCAXJoMD2HodiZ6lEjrfWfL+E3zgfXUew/zzkY3fJcrqU GOjCS7HByTb+IojepK6Sn9gEfKdM2jIAUu7kcCoSUMrEs53hHnBA56oMaSkmKaBsD6 az20DE+duY3aA== X-Virus-Scanned: amavisd-new at wurm.cx Received: from synchrony.wurm.cx ([127.0.0.1]) by localhost (synchrony.wurm.cx [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gF6-NoTbBQ22 for ; Wed, 29 Nov 2017 12:01:02 -0600 (CST) Received: from synchrony.wurm.cx (localhost [127.0.0.1]) by synchrony.wurm.cx (Postfix) with ESMTPA id 51F315401E for ; Wed, 29 Nov 2017 12:01:02 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=skarsol.com; s=synchrony; t=1511978462; bh=LN5UYsC1N6UvhCdwp6ESQDP8RAPUiWTxCAmRjk7VcyE=; h=Date:From:To:Subject; b=k9tYQgtsXIz1oOuEFI9T4mb3bVNMJwS4B9Tk6HPIrRPJzL5v6aLqwLZeWMQiqpOEy nv5ZwlBZgK6tWss+0Zo2Qv0c+YjCk/ZuNYSLAejJIaKb6HBYwYoUyASoCqctnNIA+6 s/Im4ZT04x8js51L1ErK+CZ7231Z8MYcQv48hcCXo+t4pvSB7/GSnWi7mu3bc+4Fk1 0+gTIR4qJof4ZVkcNKSVBdCAXJoMD2HodiZ6lEjrfWfL+E3zgfXUew/zzkY3fJcrqU GOjCS7HByTb+IojepK6Sn9gEfKdM2jIAUu7kcCoSUMrEs53hHnBA56oMaSkmKaBsD6 az20DE+duY3aA== MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 29 Nov 2017 12:01:02 -0600 From: Skarsol To: pgsql-bugs@postgresql.org Subject: RE: BUG #14891: Old cancel request presented by pgbouncer honored after skipping a query. Message-ID: X-Sender: postgresql@skarsol.com User-Agent: Roundcube Webmail/0.9.5 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Well, taking pgbouncer down to a 60 second connection lifetime was insufficient to completely alleviate this. We had another transaction get killed yesterday due to a different query being cancelled. I'm still unsure how this isn't affecting other people. At this point, we're going to change our application to just abandon the current postgres connection when a user hits cancel instead of actually sending the cancel request. Ugly hack, but I'm not sure what else to do at this point. I'm still open to suggestions though. Or really, any discussion about this issue at all. Would this belong better on a different list? ----- The following bug has been logged on the website: Bug reference: 14891 Logged by: Skarsol Email address: postgresql(at)skarsol(dot)com PostgreSQL version: 9.6.3 Operating system: Linux 4.4.8-hardened-r1 #4 SMP Mon Jun 12 Description: This might be a symptom of the issue discussed in the ToDo "Changes to make cancellations more reliable and more secure" but as it is related to the pgbouncer bug I've opened at https://github.com/pgbouncer/pgbouncer/issues/245 I figured I'd post it over here just to make sure. As the last step of this bug, pgbouncer 1.7.2 presents a cancel request to postgres 9.6.3. This request targets pid 29330 which is connected to pgbouncer on port 33024. That pid then accepts a new query, returns a result set, accepts another new query, and then cancels that one out. Expected behavior would have been for either no cancel (as that pid was between queries at the time) or to cancel the first query. Cancelling the 2nd query is just weird (to me). I have no idea how much of this is related to whatever pgbouncer is doing to delay the cancel in the first place before presenting it to postgres. I'm aware that we're 2 minor versions behind, but I don't see anything that seems relevant to this in the changelogs. Image of the relevant wireshark display at https://user-images.githubusercontent.com/1915152/32578433-d5d4a71c-c4a2-11e7-9d25-f59d5afbb06b.jpg