0
Fork 0
mirror of https://github.com/project-zot/zot.git synced 2024-12-16 21:56:37 -05:00
zot/test/blackbox
peusebiu 7642e5af98
fix(scheduler): fix data race (#2085)
* fix(scheduler): data race when pushing new tasks

the problem here is that scheduler can be closed in two ways:
- canceling the context given as argument to scheduler.RunScheduler()
- running scheduler.Shutdown()

because of this shutdown can trigger a data race between calling scheduler.inShutdown()
and actually pushing tasks into the pool workers

solved that by keeping a quit channel and listening on both quit channel and ctx.Done()
and closing the worker chan and scheduler afterwards.

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>

* refactor(scheduler): refactor into a single shutdown

before this we could stop scheduler either by closing the context
provided to RunScheduler(ctx) or by running Shutdown().

simplify things by getting rid of the external context in RunScheduler().
keep an internal context in the scheduler itself and pass it down to all tasks.

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>

---------

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
2023-12-11 10:00:34 -08:00
..
annotations.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
anonymous_policy.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
ci.sh ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
cloud_only.bats refactor(metadb): improve UX by speeding up metadb serialize/deserialize (#1842) 2023-10-30 13:06:04 -07:00
cve.bats test(bats): fix CVE bats test failure if zot runs on different port than 8080 (#2072) 2023-11-21 16:31:12 +02:00
delete_images.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
detect_manifest_collision.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
garbage_collect.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
helpers_cloud.bash ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
helpers_metrics.bash fix: metrics should be protected behind authZ (#1895) 2023-10-20 10:33:26 +03:00
helpers_scrub.bash ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
helpers_wait.bash fix: bats test refactoring (#1731) 2023-08-30 12:24:28 -07:00
helpers_zot.bash test(bats): fix CVE bats test failure if zot runs on different port than 8080 (#2072) 2023-11-21 16:31:12 +02:00
metadata.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
metrics.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
metrics_minimal.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
pushpull.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
pushpull_authn.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
pushpull_running_dedupe.bats fix(nightly): increase nightly delays and timeouts (#1877) 2023-10-12 16:42:07 +03:00
referrers.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
restore_s3_blobs.bats ci(nightly): fix nightly after log message refactor (#2121) 2023-12-11 15:39:32 +02:00
scrub.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
sync.bats fix(scheduler): fix data race (#2085) 2023-12-11 10:00:34 -08:00
sync_cloud.bats fix(scheduler): fix data race (#2085) 2023-12-11 10:00:34 -08:00
sync_docker.bats ci: resource tuning for faster runs (#1967) 2023-11-15 10:44:31 -08:00
sync_harness.bats ci(nightly): fix nightly after log message refactor (#2121) 2023-12-11 15:39:32 +02:00
sync_replica_cluster.bats fix(scheduler): fix data race (#2085) 2023-12-11 10:00:34 -08:00