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
Bundle directory has slightly different files (compressed, etc.) and
does not contain any JSON files so let's just collect all files from
there.
Signed-off-by: Igor Raits <igor.raits@gmail.com>
Prior to this change, Koji would always send messages with a hard-coded
topic:// prefix.
This works fine for ActiveMQ 5 and Artemis, but RabbitMQ does not
support that syntax. Instead, RabbitMQ brokers expect clients to use
topic addresses with a "/topic/" prefix.
The RFE for RabbitMQ to support "topic://" prefixes is
https://github.com/rabbitmq/rabbitmq-server/issues/2583
In the meantime, allow users to specify "topic://" or "/topic/"
explicitly in their configuration.
For backwards-compatibility, if the user chose neither "topic://" nor
"/topic/", prepend the "topic://" string, preserving the plugin's
existing behavior.
(Note: ActiveMQ 5 advertises its expected topic:// prefix in the initial
connection properties, so we could read that value dynamically, but
RabbitMQ and Artemis do not send an expected topic prefix connection
properties, so we just make the user choose explicitly here.)
This is a relic of an earlier version of the db work.
At this point in the code, there is never an id field.
We don't re-store messages from the db. We only delete them
after confirmed send.
In koji-1.22.0-129-g0ef3c751 I've changed the way how
site-packages directory is obtained. What I did not realize back
then is there can be multilib systems which will not search for
packages in /usr/lib64. But 64bit systems do look into /usr/lib.
Therefore, let's pick the location where both systems work.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1894261Fixes: #2578https://pagure.io/koji/issue/2578
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
include new table in main schema, since this plugin is part of Koji itself
clean up and expand the docs for this plugin
refactor query_from_db() into handle_db_msgs()
* fix lock error cases
* only delete messages from queue if we successfully send them
* handle test_mode
allow test_mode to exercise db queue via test_mode_fail setting