BUG: MySQL does not reconnect if connection is dropped
If MySQL has a connection to a server and the server becomes unavaiable, it doesnt reconnect when the server is up again. Motion is still running, but nothing is written to the database.
I have a cvs version of Motion, but dont remember which one. The problem was there with 3.2.6 also though.
Oct 10 01:00:01 [motion] [5] Mysql query failed: Broken pipe
Oct 10 01:00:01 [motion] [2] Mysql query failed: Success
Oct 10 01:00:01 [motion] [1] Mysql query failed: Broken pipe
Oct 10 01:00:01 [motion] [3] Mysql query failed: Broken pipe
Oct 10 01:00:01 [motion] [4] Mysql query failed: Success
Environment
Motion version: |
3.2.7 |
ffmpeg version: |
0.4.9_p20060530 |
Shared libraries: |
ffmpeg, mysql |
Server OS: |
kernel 2.6.12-gentoo-r10 |
--
GunnarSkjold - 10 Oct 2006
Follow up
Yes , that's a known issue. Motion needs a recover functions for database connection.
Let me some days to talk with Kenneth about it.
--
AngelCarpintero - 18 Nov 2006
Fix record
I think we need Motion to try and re-run the connection to MySQL when the connection is lost.
I have the feeling that the connection is normally lost because of a software bug in the MySQL code or other temporary glitches and that in 99.99% of the cases Motion could just reconnect and save what it has to save.
But if the MySQL server is temporarily down then I think it will be a feature overkill to try and save the SQL calls for when the server is up again. Then I would simply discard them.
So something like
- Assume MySQL connection is established.
- Write SQL statement.
- If this failed try to reconnect.
- If this reconnect fails give up and discard the SQL statement.
- If reconnect is successful write the SQL statement to the database.
--
KennethLavrsen - 20 Nov 2006
Done , if you want to check the fix get latest svn version ( i did the commit in r143 ).
Reopen the bug if the problem remains .
--
AngelCarpintero - 21 Nov 2006