<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Open Sans";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:right;
        direction:rtl;
        unicode-bidi:embed;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">Hi All,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">I'm using pgpool 3.6.4 master-slave with load balancing.&nbsp; On many occasions a database
 exception is not passed to the application and the application get stuck.&nbsp; I opened a bug -
<a href="https://www.pgpool.net/mantisbt/view.php?id=318">https://www.pgpool.net/mantisbt/view.php?id=318</a> &nbsp;but pgpool developers were not able to reproduce it yet.&nbsp; I will greatly appreciate if some of you could please run the following script and check
 if the bug is reproduced on your setup.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">To run the sh script you need to have &nbsp;&nbsp;pgproto (</span><span style="font-size:14.0pt"><a href="https://github.com/tatsuo-ishii/pgproto"><span style="font-family:&quot;Open Sans&quot;,serif;color:#337AB7;text-decoration:none">https://github.com/tatsuo-ishii/pgproto</span></a></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">)&nbsp;&nbsp;
 which was developed by Tatsuo-ishii to simulate pgpool problems.</span><span style="font-size:14.0pt"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">The following is a short shell script to run pgproto in a loop.&nbsp; The bug318.data input
 file is also supplied below.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">Please note that it fails on setup running pgpool 3.6.4 with replication master&#43;slave and
 load balancing. If you have setup with only master (slave is down) you will not see the bug. Please run the sh script and see if it manage to finish the loop without error.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">#!/bin/bash</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">File=&quot;./run_test.log&quot;</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">for ((n=0; n&lt;10000; n&#43;&#43;))</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">do<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">(</span><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">&nbsp;&nbsp; echo &quot;iteration $n &quot;</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><span dir="LTR"></span>&nbsp;&nbsp; pgproto -f bug318.data -p 9999 &#8211;h your_ip_address
 -u postgres -d your_db_name &gt; $File;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">) 2&gt;&amp;1 | awk '{ print strftime(&quot;%Y-%m-%d %H:%M:%S:&quot;), $0; fflush(); }' | tee -a &quot;$File&quot;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">if grep -q Terminate &quot;$File&quot;; then</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><span dir="LTR"></span>&nbsp;&nbsp; echo &quot;ok&quot;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">else<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">&nbsp;&nbsp; echo &quot;Bug&quot;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">&nbsp;&nbsp; exit<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">fi<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">done<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">---------------------------------------------------------------------------------------------------------------</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8">The following is a bug318.data used by the batch script (which calls pgproto)</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">#</span><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span>'Q'&nbsp;&nbsp;&nbsp;&nbsp; &quot;SET statement_timeout = '4s'&quot;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span># Receive response from backend<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'Y'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span># Execute statement<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'P'&nbsp;&nbsp;&nbsp;&nbsp; &quot;S1&quot;&nbsp;&nbsp;&nbsp; &quot;SELECT 1/0&quot;&nbsp;&nbsp;&nbsp; 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'B'&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;S1&quot;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'E'&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'C'&nbsp;&nbsp;&nbsp;&nbsp; 'S'&nbsp;&nbsp;&nbsp;&nbsp; &quot;S1&quot;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span># Execute statement<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'P'&nbsp;&nbsp;&nbsp;&nbsp; &quot;S2&quot;&nbsp;&nbsp;&nbsp; &quot;SELECT 1/0&quot;&nbsp;&nbsp;&nbsp; 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'B'&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;S2&quot;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'E'&nbsp;&nbsp;&nbsp;&nbsp; &quot;&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'C'&nbsp;&nbsp;&nbsp;&nbsp; 'S'&nbsp;&nbsp;&nbsp;&nbsp; &quot;S2&quot;<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span># Issue Sync message<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'S'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span># Receive response from backend<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'Y'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span lang="HE" dir="RTL" style="font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;color:#1F497D;background:#E8E8E8"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span dir="LTR"></span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8"><span dir="LTR"></span># Send terminate message<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:#1F497D;background:#E8E8E8">'X'</span><span style="font-size:14.0pt;font-family:&quot;Open Sans&quot;,serif;color:black;background:#E8E8E8"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:left;direction:ltr;unicode-bidi:embed"><span style="font-size:14.0pt"><o:p>&nbsp;</o:p></span></p>
</div>
IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you
 should not copy or use this e-mail for any purpose nor disclose its contents to any person.
</body>
</html>