This happens during constant load.

This morning I found a way to re-create this issue on a production system, but after restarting Kamailio I could not force this to happen again. My feeling, although not proven, is that the DB connection is dropped/timed out at some point and re-connecting is not working properly.

Looking at the connections on the database server it looks like some of the Kamailio childs have been sleeping for quite some time and others are used often:

| 22750784 | acc_user             | 1.2.3.4:49102   | acc        | Sleep       |      0 |                                                                             | NULL             |
| 22750785 | acc_user             | 1.2.3.4:49101   | acc        | Sleep       |      1 |                                                                             | NULL             |
| 22750786 | acc_user             | 1.2.3.4:49103   | acc        | Sleep       |      6 |                                                                             | NULL             |
| 22750787 | acc_user             | 1.2.3.4:49105   | acc        | Sleep       |      0 |                                                                             | NULL             |
| 22750789 | acc_user             | 1.2.3.4:49107   | acc        | Sleep       |      2 |                                                                             | NULL             |
| 22750790 | acc_user             | 1.2.3.4:49108   | acc        | Sleep       |   3905 |                                                                             | NULL             |
| 22750791 | acc_user             | 1.2.3.4:49106   | acc        | Sleep       |      0 |                                                                             | NULL             |
| 22750792 | acc_user             | 1.2.3.4:49112   | acc        | Sleep       |    653 |                                                                             | NULL             |
| 22750793 | acc_user             | 1.2.3.4:49109   | acc        | Sleep       |      2 |                                                                             | NULL             |
| 22750794 | acc_user             | 1.2.3.4:49110   | acc        | Sleep       |   1551 |                                                                             | NULL             |
| 22750795 | acc_user             | 1.2.3.4:49114   | acc        | Sleep       |   6217 |                                                                             | NULL             |
| 22750796 | acc_user             | 1.2.3.4:49111   | acc        | Sleep       |   5110 |                                                                             | NULL             |
| 22750797 | acc_user             | 1.2.3.4:49113   | acc        | Sleep       |   8605 |                                                                             | NULL             |
| 22750798 | acc_user             | 1.2.3.4:49115   | acc        | Sleep       |      0 |                                                                             | NULL             |
| 22750812 | kam_user             | 1.2.3.4:49117   | routing_db | Sleep       |    190 |                                                                             | NULL             |
| 22750813 | kam_user             | 1.2.3.4:49121   | routing_db | Sleep       |  11665 |                                                                             | NULL             |
| 22750814 | kam_user             | 1.2.3.4:49119   | routing_db | Sleep       |      0 |                                                                             | NULL             |
| 22750816 | kam_user             | 1.2.3.4:49123   | routing_db | Sleep       |      2 |                                                                             | NULL             |
| 22750818 | kam_user             | 1.2.3.4:49127   | routing_db | Sleep       |      0 |                                                                             | NULL             |
| 22750819 | kam_user             | 1.2.3.4:49125   | routing_db | Sleep       |     10 |                                                                             | NULL             |
| 22750820 | kam_user             | 1.2.3.4:49129   | routing_db | Sleep       |     30 |                                                                             | NULL             |
| 22751056 | kam_user             | 1.2.3.4:49205   | routing_db | Sleep       |      0 |                                                                             | NULL             |
| 22751057 | kam_user             | 1.2.3.4:49206   | routing_db | Sleep       |      1 |                                                                             | NULL             |
| 22751058 | kam_user             | 1.2.3.4:49208   | routing_db | Sleep       |      0 |                                                                             | NULL             |
| 22751059 | kam_user             | 1.2.3.4:49207   | routing_db | Sleep       |  11660 |                                                                             | NULL             |
| 22751060 | kam_user             | 1.2.3.4:49209   | routing_db | Sleep       |      1 |                                                                             | NULL             |
| 22751061 | kam_user             | 1.2.3.4:49210   | routing_db | Sleep       |    130 |                                                                             | NULL             |
| 22751062 | kam_user             | 1.2.3.4:49211   | routing_db | Sleep       |     70 |                                                                             | NULL             |
| 22751063 | kam_user             | 1.2.3.4:49212   | routing_db | Sleep       |      0 |                                                                             | NULL             |

What will actually happen in the MySQL API when a query is ran on a connection that has been closed?


Reply to this email directly or view it on GitHub.