#1762 koji-sweep-db VACUUM inside a transaction
Closed: Fixed 4 years ago by tkopecek. Opened 4 years ago by jforaker.

Receiving the following error in 1.19.0:

[root@koji ~]# /usr/sbin/koji-sweep-db
No handlers could be found for logger "koji.db"
Traceback (most recent call last):
  File "/usr/sbin/koji-sweep-db", line 87, in <module>
    clean_sessions(cursor, options.vacuum)
  File "/usr/sbin/koji-sweep-db", line 19, in clean_sessions
    cursor.execute("VACUUM ANALYZE sessions")
  File "/usr/lib/python2.7/site-packages/koji/db.py", line 136, in execute
    ret = self.cursor.execute(operation, parameters)
psycopg2.InternalError: VACUUM cannot run inside a transaction block

It's possible that I'm turning this up due to using older versions of psycopg2/postgresql, but documentation seems to indicate that modern versions of PostgreSQL still don't support VACUUM in transactions, and psycopg2 still leaves transactions open when idle.
Turning on autocommit does work around the issue.


Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.20
- Issue tagged with: bug

4 years ago

Metadata Update from @jcupova:
- Issue tagged with: testing-done

4 years ago

Login to comment on this ticket.

Metadata