debian-forge-composer/internal
Ondřej Budai c4c7f44fcb dbjobqueue: reimplement the jobqueue to use only one listening connection
Previously, all dequeuers (goroutines waiting for a job to be dequeued) were
listening for new messages on postgres channel jobs (LISTEN jobs). This didn't
scale well as each dequeuer required to have its own DB connection and the
number of DB connections is hard-limited in the pool's config.

I changed the logic to work somewhat differently: dbjobqueue.New() now spawns
a goroutine that listens on the postgres channel. If there's a new message,
the goroutine just wakes up all dequeuers using a standard go channel.
Go channels are cheap so this should scale much better.

A test was added that confirms that 100 dequeuers are not a big deal now. This
test failed when I tried to run on it on the previous commit. I tried even 1000
locally and it was still fine.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-03-11 16:04:52 +01:00
..
auth api/{cloud,worker}: used channel name based on JWT claims for new jobs 2022-03-08 12:07:00 +01:00
blueprint distro/rhel86: add fido dracut module and enable customizing onboarding 2022-02-24 17:07:34 +01:00
boot tests: update IDs in Openstack image boot test 2022-02-14 12:13:18 +02:00
client client: Add Cancel function and tests 2022-02-18 09:31:07 +01:00
cloud internal/cloud: Allow aws creds from defaults 2022-02-21 15:43:53 +01:00
cloudapi cmd/osbuild-worker: dnf-json returns MarkingErrors (plural) 2022-03-11 10:13:27 +01:00
common internal/common: introduce function to convert data sizes 2021-11-02 18:32:47 +01:00
crypt crypt: add automatic darwin support 2020-07-17 07:48:22 +02:00
disk ditro/rhel86: set volid like in rhel9.0 2022-02-28 23:05:45 +00:00
distro distro/rhel86: set GPGKeyFiles for azure-rhui 2022-03-05 21:04:24 +01:00
distroregistry distroregistry: enable CS9 2022-02-18 10:39:08 +00:00
jobqueue dbjobqueue: reimplement the jobqueue to use only one listening connection 2022-03-11 16:04:52 +01:00
jsondb gosec: G306-WriteFile permissions higher than 0600 2021-12-13 12:17:30 +02:00
kojiapi jobqueue: introduce the concept of channels 2022-03-08 12:07:00 +01:00
mocks worker: NewServer: move config parameters to a new Config struct 2022-03-08 12:07:00 +01:00
osbuild1 osbuild2: add X11Keymap option to KeymapStageOptions 2022-02-27 22:03:36 +01:00
osbuild2 osbuild2: expose new gpgkeys.fromtree osbuild option 2022-03-05 21:04:24 +01:00
ostree ostree: rename errors and introduce ParameterComboError 2022-02-23 11:08:24 +01:00
prometheus metrics: change job metrics namespace 2022-02-08 15:57:12 +01:00
reporegistry reporegistry: remove unused ReposByArch() function 2022-03-09 23:22:06 +00:00
rhsm internal/rhsm: implement fallback to the previous mechanism 2021-08-09 12:40:23 +02:00
rpmmd Move OSBuildMetadataToRPMs and PackageMetadataToSignature to osbuild2 2022-02-18 09:26:35 +01:00
store weldr: allow running on unsupported distros 2022-03-09 23:22:06 +00:00
target Add support for OCI upload provider 2022-01-28 15:16:47 +01:00
test internal/test: add small library for tests 2022-03-08 12:07:00 +01:00
upload koji: Reduce excessive logging by retryablehttp 2022-03-09 23:18:25 +00:00
weldr weldr: remove the (host) architecture member from the API struct 2022-03-09 23:22:06 +00:00
worker cmd/osbuild-worker: dnf-json returns MarkingErrors (plural) 2022-03-11 10:13:27 +01:00
tools.go go: vendor the oapi-codegen cmd 2021-02-01 15:32:58 +01:00