<p>Hi,</p>

<p>having some rare issues writing acc-data to a remote MySQL server. The connection is made using the MySQL SSL options. Most, 99,9%, of the writes work well.</p>

<p>The error is:</p>

<pre><code>Nov 20 13:48:55 /usr/sbin/kamailio[28976]: WARNING: db_mysql [km_dbase.c:84]: db_mysql_submit_query(): driver error on ping: SSL connection error: socket layer receive error
Nov 20 13:48:55 /usr/sbin/kamailio[28976]: ERROR: db_mysql [km_dbase.c:121]: db_mysql_submit_query(): driver error on query: SSL connection error: socket layer receive error
Nov 20 13:48:55 /usr/sbin/kamailio[28976]: ERROR: <core> [db_query.c:235]: db_do_insert_cmd(): error while submitting query
</code></pre>

<p>Apart from the connection details (using [mysql-ssl-conf] for the SSL config block) I have this config:</p>

<pre><code>modparam("db_mysql", "ping_interval", 30);
modparam("db_mysql", "timeout_interval", 8);
</code></pre>

<p>The documentation suggests that "ping_interval" is the "Time interval in seconds to send ping messages to MySQL server in order to keep the connection open." However, looking at the code this seems a bit misleading because it looks like the ping is only done on an actual query (db_mysql_submit_query), i.e. not with a regular interval/on a timer as suggested by the documentation?</p>

<p>Also the "auto_reconnect" parameter is stated as default 1 (on), but in the code this is just used as a "retry" of the query itself and MYSQL_OPT_RECONNECT is never set on the connection (<a href="https://dev.mysql.com/doc/refman/5.5/en/auto-reconnect.html">https://dev.mysql.com/doc/refman/5.5/en/auto-reconnect.html</a>)? Maybe this is not necessary and it's enough to just re-try the query?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/406">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZVFen70rGScOZbdjQc9SfuUGffyRks5pHy-5gaJpZM4Gmb_R.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/406"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>