#3173 db: logging option for cursor
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue2837  into  master

Download 3173.patch

In some cases we expect query to fail (LOCK NOWAIT) but it still
clutters the logs. Option for not logging cursor-level errors.

Fixes: https://pagure.io/koji/issue/2837

I'm not sure if also use log=False for Savepoint's rollback?

1 new commit added

  • fix tests

If not, maybe update of _dml is not necessary for now as nothing will use it.

2 new commits added

  • fix tests
  • db: logging option for cursor

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Yeah, the Savepoint part is much more complex. We don't actually expect the savepoint queries to fail, but the queries that we're using the savepoint for. The only place we currently do this is in add_external_rpm, but this code that's working around a race. It's not a super frequent case, and probably not really necessary to hide the query error in the logs.

So, I guess the thing to do is just to drop the _dml changes here and leave the Savepoint business alone.

It might be better to rename this argument to log_errors since it doesn't disable all logging, just the errors.

Other than that, good-to-go

rebased onto e7db7d8b533eb6bdccd17ddaed31cc67cd64602f

1 new commit added

  • rename option

Commit 7fe0d10d fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

Metadata