8000 [BTS-2166] Create async registry metrics during feature prepare by goedderz · Pull Request #21834 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

[BTS-2166] Create async registry metrics during feature prepare #21834

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
devel
-----

* Fix BTS-2166: Fix a race during startup, where the async registry's metrics
might be created before the scheduler starts its first thread. This is
currently not known to cause any issues.

* Fix BTS-2139: GeoJSON coordinate validation now properly accepts both 2D and 3D
coordinates for Point geometries.

Expand Down
11 changes: 7 additions & 4 deletions arangod/SystemMonitor/AsyncRegistry/Feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ DECLARE_COUNTER(arangodb_async_thread_registries_total,
"Total number of threads that started asynchronous operations "
"since database creation");

DECLARE_GAUGE(
arangodb_async_existing_thread_registries, std::uint64_t,
"Number of threads that started currently existing asyncronous operations");
DECLARE_GAUGE(arangodb_async_existing_thread_registries, std::uint64_t,
"Number of threads that started currently existing asynchronous "
"operations");

Feature::Feature(Server& server)
: ArangodFeature{server, *this}, _async_mutex{_schedulerWrapper} {
Expand Down Expand Up @@ -91,10 +91,13 @@ struct Feature::PromiseCleanupThread {
std::jthread _thread;
};

void Feature::start() {
void Feature::prepare() {
metrics = create_metrics(
server().template getFeature<arangodb::metrics::MetricsFeature>());
registry.set_metrics(metrics);
}

void Feature::start() {
_cleanupThread = std::make_shared<PromiseCleanupThread>(_options.gc_timeout);
}

Expand Down
1 change: 1 addition & 0 deletions arangod/SystemMonitor/AsyncRegistry/Feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class Feature final : public ArangodFeature {

~Feature();

void prepare() override final;
void start() override final;
void stop() override final;
void collectOptions(std::shared_ptr<options::ProgramOptions>) override final;
Expand Down
0