Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eBpcL-0001MC-4k for pgsql-general@arkaria.postgresql.org; Mon, 06 Nov 2017 22:11:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eBpcK-0002on-Lw for pgsql-general@arkaria.postgresql.org; Mon, 06 Nov 2017 22:11:40 +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 1eBpZt-0006Kz-BG for pgsql-general@postgresql.org; Mon, 06 Nov 2017 22:09:09 +0000 Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eBpZl-0000ea-K7 for pgsql-general@postgresql.org; Mon, 06 Nov 2017 22:09:08 +0000 Received: by mail-pf0-x236.google.com with SMTP id b79so8755332pfk.5 for ; Mon, 06 Nov 2017 14:09:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=NpawgM6iwkdhCjjyRgXD712A0+By6UZP3+l4xKQf500=; b=FQQq615uKNDKYRizI0WDZMamrdUb4shySU8bjs8986H6tqppx11y4uVOSYBpQmjAWY WkYgKc1N2V42ufdCB9DRys6biXYbdgauVJJSw646LgZRjWQBi9INQ9S9LWLlN6cXru3A sIygcgkpMTL8Db2YWx5Eh8+xREGJ52NKCRw0me2Fj7R8eO2hjxnO46KquwmSe54OsqU8 9Pqzpb3mOSfuSPR5QvItOm+v8pHwqYLLCNiz+/qchS8Ao6MnCR0uxuD/uBn6Jk0YiW+Q rQ/nSYPJFFHMxLdd22xW8AQRcxn2Lwo3YcCJMy8kOLYurDdd3WKJ5HRtiSwjyxmmB7WY kctg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=NpawgM6iwkdhCjjyRgXD712A0+By6UZP3+l4xKQf500=; b=UJpXrMFdnBk1pEFpUk8vY+SaJMlmerTzSxABEAf+06egOiBUQO5HDSZxqTMH+1FdyB l07l3wy1UpmewBOGT73k4N9ws2dnyV3cgzuSFU0WzoTJK0DLKzZzKu1pwcXx3u3Uf3j5 WkizhD2iz7AyPbI3gFfi+hb2W1iaTHo+RIo3xJ8RGGZJXfuinKE98iysWsztWo30RbUP SF6m011aZB+qrkMxrKl4LGteOJayvDKIKFwvqiovEY++Q2Gdmc8A6BKru+4Swh2+fgtf zbf9UCV0VLQ8BYeB+OcPzP5AcX0lmAKYs9I9ea5oNwOxDDKbgNfSioCH5fCMIqu+v/rL eylA== X-Gm-Message-State: AMCzsaVU6QgA4zZ71OV+od68K7m87eTn6NJ9/6L2sunX0whwC63QxCGN RmeruP4f3MS8glefyMfbTZRrAGNZ X-Google-Smtp-Source: ABhQp+RRXre/x+yNYvIjzWOwfL7/gQbRlMuoEjHEWciK+MRcyMAmG9B+MuMCpQ6z/anF2Qn5xr6c2A== X-Received: by 10.84.239.22 with SMTP id w22mr15961843plk.24.1510006138813; Mon, 06 Nov 2017 14:08:58 -0800 (PST) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id z8sm25164227pfl.135.2017.11.06.14.08.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 14:08:57 -0800 (PST) Subject: Re: idle in transaction, why To: Merlin Moncure References: <4a365db4-8608-65c8-e3dc-23524f881bc3@gmail.com> <16893.1509999467@sss.pgh.pa.us> <6ed9ca9b-fb80-e505-2522-be9b5f63a759@gmail.com> <19493.1510000892@sss.pgh.pa.us> <81aa980b-fb4c-e9b4-fa82-9f14df71a2df@gmail.com> Cc: Tom Lane , "David G. Johnston" , "pgsql-general@postgresql.org" From: Rob Sargent Message-ID: <5d130fce-3f5c-fb0a-4bf0-3163c14fc49a@gmail.com> Date: Mon, 6 Nov 2017 15:09:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------AEE13C3B792C15FB57491831" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org This is a multi-part message in MIME format. --------------AEE13C3B792C15FB57491831 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 11/06/2017 02:38 PM, Merlin Moncure wrote: > On Mon, Nov 6, 2017 at 2:50 PM, Rob Sargent wrote: >> >> On 11/06/2017 01:41 PM, Tom Lane wrote: >>> Rob Sargent writes: >>>> idle_in_transaction_session_timeout | 0 | default | >>>> | | A value of 0 turns off the timeout. | user >>> Meh. I think we're barking up the wrong tree anyway: so far as I can >>> find, there is no error message reading 'idle transaction timeout' >>> in the existing PG sources (and I sure hope no committer would have >>> thought that such an ambiguous message text was satisfactory). >>> So I think your error is coming from client-side or third-party code. >>> What other moving parts have you got in there? >>> >>> regards, tom lane >> The most likely culprit is JOOQ, which I chose as a learning experience >> (normally I use ORM tools). But that said, I just ran the same data into my >> test env, (postgres 10.0 (real) on centos 6.9, ubuntu client) and all went >> swimmingly. It's a sizable payload (several batches of over 100K items, >> deserialized from json) and takes 5 minutes to save. >> >> I was hoping to blame the virt or the beta. Not a good time to start doubt >> JOOQ > I can't speak to JOOQ (who are fantastic postgres supporters BTW), but > in the java world this typically comes from one of two things: > > 1) you have long running in-transaction process that has very heavy > computation between sql statements. this is a rare case > --or-- > 2) you are connecting pooling and the app sent a connection back into > the pool without having a transaction committed. > > "2" is a common and dangerous bug. It can happen due to bug in > application code (most likely), the jdbc wrapping library code (less > likely), or the connection pooler itself if you're using one. A > typical cause of application side problems is manual transaction > management and some uncaught exception paths where errors (say, a > duplicate key error). So investigate causes like that first > (database errors in the database log might be a helpful clue) and go > from there. If the problem is within JOOQ, you ought to take it up > with them, which I encourage you to do, since I consider JOOQ to be a > wonderful treatment of SQL integration from the java perspective. > > merlin Gosh I wish I could learn to proof-read my posts. My support crew graciously set idle_transaction_timeout = 1 Now to ponder if I need zero or some large number. Thanks again --------------AEE13C3B792C15FB57491831 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit



On 11/06/2017 02:38 PM, Merlin Moncure wrote:
On Mon, Nov 6, 2017 at 2:50 PM, Rob Sargent <robjsargent@gmail.com> wrote:

On 11/06/2017 01:41 PM, Tom Lane wrote:
Rob Sargent <robjsargent@gmail.com> writes:
   idle_in_transaction_session_timeout | 0       | default |
|            | A value of 0 turns off the timeout. | user
Meh.  I think we're barking up the wrong tree anyway: so far as I can
find, there is no error message reading 'idle transaction timeout'
in the existing PG sources (and I sure hope no committer would have
thought that such an ambiguous message text was satisfactory).
So I think your error is coming from client-side or third-party code.
What other moving parts have you got in there?

                        regards, tom lane
The most likely culprit is JOOQ, which I chose as a learning experience
(normally I use ORM tools).  But that said, I just ran the same data into my
test env, (postgres 10.0 (real) on centos 6.9, ubuntu client) and all went
swimmingly.  It's a sizable payload (several batches of over 100K items,
deserialized from json) and takes 5 minutes to save.

I was hoping to blame the virt or the beta.  Not a good time to start doubt
JOOQ
I can't speak to JOOQ (who are fantastic postgres supporters BTW), but
in the java world this typically comes from one of two things:

1) you have long running in-transaction process that has very heavy
computation between sql statements.  this is a rare case
--or--
2) you are connecting pooling and the app sent a connection back into
the pool without having a transaction committed.

"2" is a common and dangerous bug.  It can happen due to bug in
application code (most likely), the jdbc wrapping library code (less
likely), or the connection pooler itself if you're using one.  A
typical cause of application side problems is manual transaction
management and some uncaught exception paths where errors (say, a
duplicate key error).  So investigate causes like that first
(database errors in the database log might be a helpful clue) and go
from there.   If the problem is within JOOQ, you ought to take it up
with them, which I encourage you to do, since I consider JOOQ to be a
wonderful treatment of SQL integration from the java perspective.

merlin
Gosh I wish I could learn to proof-read my posts.
My support crew graciously set
                                                                                                                                                     idle_transaction_timeout = 1

Now to ponder if I need zero or some large number.

Thanks again
--------------AEE13C3B792C15FB57491831--