This is a cross-post to both pgbouncer and jooq lists, as I am unsure where in my stack I need to address this issue.

I am testing my throughput by intensionally swamping my systems. The stack I am using consists of
- postgres 10
- pgbouncer 1.7.2 (running on db machine)
- collector (java Selector programme running on NOT db machine)
- clients (java analysis running on machine(s) NOT db NOT collector)

The clients are spawned from GNU parallel, one second delay each, 100 jobs with max 16 concurrent (hyper-threaded processor count) and last for about 10 seconds. The clients all finish successfully and more quickly than I can perform the rest of the stack. This is a temporary, testing situation - ultimately the clients will take much longer as I do a more realistic amount (one thousand fold more) of work per invocation.

Each client sends a payload to the collector; the collector has ThreadPoolExecutor transforming payload into db calls via jOOQ.

The payload inserts 6 new records (over three tables) and updates one record; the same record updated in all payloads.
I am NOT using PreparedStatment in my code.
pbBouncer is in "pool_mode = transaction"
The jOOQ transaction is

            ctx.transaction(ltx -> {
                    startProcess(ctx); //three inserts, two tables
                    writeSegments(ctx); //update single record by PK
   (repeated per client)
                    finishProcess(ctx); //three inserts, one table
                });

If I correctly read the error message below (the fifth of 5 attempts for same payload) I must be reusing a pooled db connection for a second payload. If so, is this pbbouncer failing to close connection after transaction; jooq not signaling end of transaction, an artifact of intentional overload; other?

   2017-08-29T17:33:25-06:00 lonepeak9 [pool-1-thread-6]
   edu.utah.camplab.jx.AbstractPayload
   d3d3a62f-64cf-4ffe-b7f8-927943af5c3e: failed write attempt #5, SQL
   [insert into "process_input" ("id", "process_id", "input_type",
   "input_ref") values (?, ?, ?, ?)]; Batch entry 0 insert into
   "process_input" ("id", "process_id", "input_type", "input_ref")
   values ('11c0e3d1-59a5-469e-a77d-89dcc98f03e0'::uuid,
   '14271c8d-31ea-4cd7-bcba-62b2436a9c21'::uuid, 'pedfile',
   'a3a1326a-cd40-4777-903f-546621028e9f') was aborted: ERROR: prepared
   statement "S_1" already exists  Call getNextException to see other
   errors in the batch.

--
You received this message because you are subscribed to the Google Groups "jOOQ User 
Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to