debian-forge-composer/vendor
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
..
cloud.google.com/go internal/cloud/gcp: use pkg.go.dev/cloud.google.com/go for Compute Engine 2022-02-03 15:35:28 +01:00
github.com koji: add HTTP retries for uploads & init/finalize 2022-03-06 11:04:37 +01:00
go.opencensus.io build(deps): bump google.golang.org/api from 0.36.0 to 0.56.0 2021-09-05 11:17:29 +02:00
golang.org/x internal/cloud/gcp: use pkg.go.dev/cloud.google.com/go for Compute Engine 2022-02-03 15:35:28 +01:00
google.golang.org internal/cloud/gcp: use pkg.go.dev/cloud.google.com/go for Compute Engine 2022-02-03 15:35:28 +01:00
gopkg.in build(deps): bump gopkg.in/ini.v1 from 1.62.1 to 1.63.0 2021-09-07 19:26:10 +02:00
modules.txt dbjobqueue: reimplement the jobqueue to use only one listening connection 2022-03-11 16:04:52 +01:00