Comment 1 for bug 1309555

Revision history for this message
Ionuț Arțăriși (mapleoin) wrote :

One dumb solution for read-only casses which works fine here looks like this:

Replace:

    meters = list(self.db.resource.find(q))

with:

    while True:
            try:
                meters = list(self.db.resource.find(q))
            except AutoReconnect:
                time.sleep(1)
            else:
                break

This could be wrapped in a reusable function, but I do not have enough ceilometer knowledge to know how to handle database queries involving writes.