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?
log=False
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
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.
Savepoint
add_external_rpm
So, I guess the thing to do is just to drop the _dml changes here and leave the Savepoint business alone.
_dml
It might be better to rename this argument to log_errors since it doesn't disable all logging, just the errors.
log_errors
Other than that, good-to-go
rebased onto e7db7d8b533eb6bdccd17ddaed31cc67cd64602f
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
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=Falsefor Savepoint's rollback?