Hi all,
I'm having a problem with the mediaproxy rtp proxy.
I'm using to do accounting into a MySQL database.
After a period of inactivity, it loses it's connection to the MySQL server and the update queries begin to fail. Openser stays connected, however.
The error in the logs is:
error: accounting failed. MySQL error: (2006, 'MySQL server has gone away')
I'm running:
mediaproxy 1.8.0 openser-1.1.0 (using the RHEL3 rpm from the openser website) openser-mysql-1.1.0 (again using the openser RHEL3 rpm) Python-2.4.4 MySQL-python-1.2.1_p2
My Python skills aren't up to much. So far, I've tried added the following line into /usr/local/mediaproxy/modules/mysql.py just before the query call, to try and re-establish the connection:
def query(self, query): self._query = query for c in range(0, 3): try: self.conn.db.ping() <<<<<<---- added by me return self.cursor.execute(query) except MySQLdb.OperationalError, why: if why[0] not in (CR.SERVER_GONE_ERROR, CR.SERVER_LOST): raise raise
... but it hasn't helped.
Has anyone seen this before?
Best regards,
James
I do not know about mediaproxy and python libraries, but there were some versions of mysql client library in the past that have the reconnection part broken. Check goolge and mysql documentation for that.
Cheers, Daniel
On 01/31/07 13:47, James Holden wrote:
Hi all,
I'm having a problem with the mediaproxy rtp proxy.
I'm using to do accounting into a MySQL database.
After a period of inactivity, it loses it's connection to the MySQL server and the update queries begin to fail. Openser stays connected, however.
The error in the logs is:
error: accounting failed. MySQL error: (2006, 'MySQL server has gone away')
I'm running:
mediaproxy 1.8.0 openser-1.1.0 (using the RHEL3 rpm from the openser website) openser-mysql-1.1.0 (again using the openser RHEL3 rpm) Python-2.4.4 MySQL-python-1.2.1_p2
My Python skills aren't up to much. So far, I've tried added the following line into /usr/local/mediaproxy/modules/mysql.py just before the query call, to try and re-establish the connection:
def query(self, query): self._query = query for c in range(0, 3): try: self.conn.db.ping() <<<<<<---- added by me return self.cursor.execute(query) except MySQLdb.OperationalError, why: if why[0] not in (CR.SERVER_GONE_ERROR, CR.SERVER_LOST): raise raise
... but it hasn't helped.
Has anyone seen this before?
Best regards,
James
Hi Daniel,
Thanks very much - I'll look into that. OpenSER maintains it's connection though, which is strange.
In reality, it may not be an issue when the box goes into production because it'll constantly have calls going through it.
I can also recover the failed queries from the error log and pass them to mysql to clean up.
Regards,
James
On Mon, Feb 05, 2007 at 12:25:29PM +0200, Daniel-Constantin Mierla wrote:
I do not know about mediaproxy and python libraries, but there were some versions of mysql client library in the past that have the reconnection part broken. Check goolge and mysql documentation for that.
Cheers, Daniel
On 01/31/07 13:47, James Holden wrote:
Hi all,
I'm having a problem with the mediaproxy rtp proxy.
I'm using to do accounting into a MySQL database.
After a period of inactivity, it loses it's connection to the MySQL server and the update queries begin to fail. Openser stays connected, however.
The error in the logs is:
error: accounting failed. MySQL error: (2006, 'MySQL server has gone away')
I'm running:
mediaproxy 1.8.0 openser-1.1.0 (using the RHEL3 rpm from the openser website) openser-mysql-1.1.0 (again using the openser RHEL3 rpm) Python-2.4.4 MySQL-python-1.2.1_p2
My Python skills aren't up to much. So far, I've tried added the following line into /usr/local/mediaproxy/modules/mysql.py just before the query call, to try and re-establish the connection:
def query(self, query): self._query = query for c in range(0, 3): try: self.conn.db.ping() <<<<<<---- added by me return self.cursor.execute(query) except MySQLdb.OperationalError, why: if why[0] not in (CR.SERVER_GONE_ERROR, CR.SERVER_LOST): raise raise
... but it hasn't helped.
Has anyone seen this before?
Best regards,
James