HenriWahl / dhcpy6d

MAC address aware DHCPv6 server written in Python
https://dhcpy6d.de
GNU General Public License v2.0
97 stars 27 forks source link

Retry query on MySQL reconnect bugfix, omit printing stack-trace #2

Closed fln closed 9 years ago

fln commented 9 years ago

There is a small bug in MySQL class, DBQuery method. If first attempt to query MySQL server fails, then connection to DB is restored but the query is never retired because "if not self.DBConnect():" is always false. The code to retry query is never executed and "None" is returned as result which in turn triggers more exceptions.

I stumbled upon this bug with a MySQL server which have a very short timeout on inactive connections.

This patch prints stack trace only if second attempt to query DB fails. First attempt only dumps exception message.

HenriWahl commented 9 years ago

Hi, thank you. I will check this as soon as possible.