pg icon indicating copy to clipboard operation
pg copied to clipboard

Query timeouts cause model mismatch errors

Open ericgorlin opened this issue 4 years ago • 3 comments

A while back we tried the following change:

opts.ReadTimeout = 3 * time.Second // max time for SELECT
opts.WriteTimeout = 3 * time.Second // max time for INSERT, UPDATE, or DELETE

We would then get occasional errors along the lines of pg: can't find column=foo in model=bar. Our theory is that timed out queries can return their outputs to other queries.

This was an issue back when we were on v6.35, and I just managed to reproduce it on v8.06 by setting timeouts of 500 milliseconds. Got it 12 times in an hour of testing merely by cranking up the number of workers in a sandbox environment.

As far as I can tell, the way to reproduce this is to have a high volume of queries which are not all the same, and some of which time out and some of which don't.

Please let me know if you need any more information. I would very much like to have query timeouts, so this is a big blocker.

ericgorlin avatar Oct 31 '19 19:10 ericgorlin

The first step here is to create a reproducer that can replicate a problem in sensible time (ideally within minutes). Without that don't expect much progress soon...

vmihailenco avatar Nov 01 '19 05:11 vmihailenco

I believe this is still an issue, BTW

ericgorlin avatar Dec 16 '19 18:12 ericgorlin

Kind of strange to close it just because I don't have time to make a reproducer, no? Maybe somebody else will encounter it and comment here

ericgorlin avatar Dec 16 '19 18:12 ericgorlin