View Issue Details

IDProjectCategoryView StatusLast Update
0000188Pgpool-IIBugpublic2016-04-20 13:55
Reporterkieren Assigned Topengbo  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionopen 
Summary0000188: pcp_proc_count truncates PIDs over 5 characters long
DescriptionIf the PgPool process IDs are over five digits in length then running pcp_proc_count will result in the PIDs being incorrectly reported. Specifically, each 6 digit PID will be truncated to 5 digits with the right most digit being removed.

Although this is the output from the PgPool command (pcp_proc_count) it results in an error in PgPool admin as the "Process Info" output will error (e1005 - pcp_proc_info command error occurred) - because the PID passed to the command is incorrect and results in a "BackendError".

We are running pgpool-II 3.4 on Centos 7.5.1511 (Core).
Steps To ReproduceThe PgPool PIDs need to be over 5 digits to show the bug but then this can be reproduced consistently using:

$ pcp_proc_count 10 localhost 9898 apgpooluser 'somepassword'
14230 13921 14292 14191 14208 ...

However the reported PIDs will all be incorrect and shortened by one digit as shown by:

$ ps -ef | grep 14230
root 142306 24222 0 17:26 ? 00:00:00 pgpool: wait for connection request

The PID is actually 142306 and not 14230.

Similarly...

$ ps -ef | grep 13921
root 139210 24222 0 16:58 ? 00:00:00 pgpool: wait for connection request

Again, the PID is 139210 and not 13921
TagsNo tags attached.

Activities

t-ishii

2016-04-06 08:05

developer   ~0000758

Interesting. How large is your system's pid max? (/proc/sys/kernel/pid_max)

kieren

2016-04-06 19:26

reporter   ~0000759

pid_max is 147456

t-ishii

2016-04-07 07:48

developer   ~0000760

pcp_proc_count thinks that 5 digit is enough for process ids. Pengbo is working on fixing it.

pengbo

2016-04-08 19:32

developer  

diff.patch (785 bytes)   
diff.patch (785 bytes)   

pengbo

2016-04-08 19:33

developer   ~0000766

Could you try this patch file that I have attached.

Issue History

Date Modified Username Field Change
2016-04-06 01:45 kieren New Issue
2016-04-06 08:05 t-ishii Note Added: 0000758
2016-04-06 10:26 t-ishii Assigned To => pengbo
2016-04-06 10:26 t-ishii Status new => assigned
2016-04-06 19:26 kieren Note Added: 0000759
2016-04-07 07:48 t-ishii Note Added: 0000760
2016-04-08 19:32 pengbo File Added: diff.patch
2016-04-08 19:33 pengbo Note Added: 0000766
2016-04-20 13:55 pengbo Status assigned => resolved