epgsql / pgapp

Erlang Postgres application that uses Poolboy and deals with the database being unavailable
MIT License
66 stars 43 forks source link

pgapp timeout issue #19

Closed jonathan-augenstine closed 7 years ago

jonathan-augenstine commented 7 years ago

We are having an issue with utilizing the pgapp on some larger queries. We are receiving timeout error reports. It works fine for smaller queries and the queries actually succeed (they are inserts to be exact), but a timeout is being reported. We are trying to understand how/where to set the timeout to a value longer than the default.

davidw commented 7 years ago

Hi,

What kind of error messages are you getting? Does it show where the timeout is happening?

jonathan-augenstine commented 7 years ago

{error, timeout} is the error we are getting. The timeout occurs when we send the query via equery and pooling we encounter the timeout. When we run the query without pooling, just calling equery after connect, then it succeeds without any timeout errors. We have tried digging in to change the timeout, but without success. We have tried via both config file and setting it dynamically before initiating the query.

seriyps commented 7 years ago

Maybe you should try pgapp:equery(PoolName, Sql, Params, Timeout) or pgapp:equery(Sql, Params, Timeout) and set Timeout to more than default 5000?

jonathan-augenstine commented 7 years ago

OK, thank you. We were setting the timeout in the connect statement and not the query. We have resolved the issue. Thank you.