View Issue Details

IDProjectCategoryView StatusLast Update
0000559Pgpool-IIBugpublic2020-04-14 13:08
ReporterpdomagalaAssigned Topengbo 
PriorityhighSeveritymajorReproducibilitysometimes
Status closedResolutionopen 
Product Version4.1.0 
Target VersionFixed in Version 
Summary0000559: Randomly closed connections
DescriptionWe've running latest PGPool v4.1.0 in docker container. Everything works flawlessly, but sometimes (under higher usage/traffic) our app returns

```
PG::UnableToSend: server closed the connection unexpectedly
 This probably means the server terminated abnormally
 before or while processing the request.
```

Also we see in PostgreSQL logs something like this:
```
2019-11-19 18:13:19 GMT LOG: could not receive data from client: Connection reset by peer
2019-11-19 18:13:19 GMT LOG: unexpected EOF on client connection with an open transaction
```.

PGPool and Postgresql configurations attached.
Steps To ReproduceThose errors are pretty random, we can't reproduce it. But it occurs at least a few times per hour.
TagsNo tags attached.

Activities

pdomagala

2019-11-20 19:28

reporter  

pg.conf (1,583 bytes)
pgpool.conf (40,349 bytes)

pdomagala

2019-11-20 19:35

reporter   ~0002971

also we use PostgreSQL 10.9-1.

pengbo

2019-11-21 09:34

developer   ~0002974

```
2019-11-19 18:13:19 GMT LOG: could not receive data from client: Connection reset by peer
2019-11-19 18:13:19 GMT LOG: unexpected EOF on client connection with an open transaction
```
The reason the connection from client is dropped.

If your application connects to PostgreSQL directly, does it occur?

pdomagala

2019-11-21 18:26

reporter   ~0002975

No, we don't have such issues when app is connected to PostgreSQL directly. Is there any chance that is occuring because we don't have enabled SSL on frontend (app->pgpool)?

Also we have set `client_idle_limit = 30`, so PGPool should kill idle connections after 30 seconds, but I see there are a lot of unclosed connections even after a couple of minutes of disconnecting app.

pengbo

2019-11-22 13:11

developer   ~0002976

> No, we don't have such issues when app is connected to PostgreSQL directly. Is there any chance that is occuring because we don't have enabled SSL on frontend (app->pgpool)?

I don't think this is the reason.

Could you share pgpool.log including "2019-11-19 18:13:19"?

pdomagala

2019-11-23 00:10

reporter   ~0002977

I've more recent logs:

APP:
```
2019-11-22T14:51:40.140Z 1 TID-ouq0pxufd WARN: ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly
2019-11-22T14:51:11.062Z 1 TID-ouxkp800l WARN: ActiveRecord::StatementInvalid: PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly
```

PGPool and PG logs attached to this comment.

pg.log (4,278 bytes)
pgpool.log (15,439 bytes)

pengbo

2019-11-27 22:54

developer   ~0002980

I have checked pgpool.log, but I could not find any errors.
Is the transaction aborted, when the connection from app is disconnected.

Can you confirm the status of the process using "ps auxwww" command, when this error occurs?

pengbo

2019-11-27 23:35

developer   ~0002981

> Also we have set `client_idle_limit = 30`, so PGPool should kill idle connections after 30 seconds, but I see there are a lot of unclosed connections even after a couple of minutes of disconnecting app.

"client_idle_limit" is the parameter to kill the idle connection between client and pgpool.
If you want to close connections to backend, you need to config "child_life_time" or "connection_life_time" parameter.

pengbo

2020-02-03 10:56

developer   ~0003119

If you have resolved this issue, may I close this one?

Issue History

Date Modified Username Field Change
2019-11-20 19:28 pdomagala New Issue
2019-11-20 19:28 pdomagala File Added: pgpool.conf
2019-11-20 19:28 pdomagala File Added: pg.conf
2019-11-20 19:35 pdomagala Note Added: 0002971
2019-11-21 09:34 pengbo Note Added: 0002974
2019-11-21 18:26 pdomagala Note Added: 0002975
2019-11-22 13:11 pengbo Note Added: 0002976
2019-11-23 00:10 pdomagala File Added: pgpool.log
2019-11-23 00:10 pdomagala File Added: pg.log
2019-11-23 00:10 pdomagala Note Added: 0002977
2019-11-27 22:45 pengbo Assigned To => pengbo
2019-11-27 22:45 pengbo Status new => assigned
2019-11-27 22:45 pengbo Description Updated View Revisions
2019-11-27 22:54 pengbo Note Added: 0002980
2019-11-27 23:35 pengbo Note Added: 0002981
2020-02-03 10:56 pengbo Status assigned => feedback
2020-02-03 10:56 pengbo Note Added: 0003119
2020-04-14 13:08 pengbo Status feedback => closed