pnorman / tilekiln

GNU General Public License v3.0
46 stars 3 forks source link

Avoid getting stuck in transaction #47

Open pnorman opened 5 months ago

pnorman commented 5 months ago

Something caused a failed transaction on a storage connection when live-serving.

  File "/home/pnorman/spirit/tilekiln/lib/python3.11/site-packages/tilekiln/tileset.py", line 55, in get_tile
    return self.storage.get_tile(self.id, tile)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pnorman/spirit/tilekiln/lib/python3.11/site-packages/tilekiln/storage.py", line 188, in get_tile
    cur.execute(f'''SELECT generated, tile FROM "{self.__schema}"."{id}"
  File "/home/pnorman/spirit/tilekiln/lib/python3.11/site-packages/psycopg/cursor.py", line 732, in execute
    raise ex.with_traceback(None)
psycopg.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block

I don't know what the cause of the error is, but if there is something wrong it shouldn't lock up the serving thread forever. Maybe autocommit would work? I need to look at the options in the library.