Skip to content

Commit

Permalink
AER-6782 - ensure config defaults based on number of CPUs don't excee…
Browse files Browse the repository at this point in the history
…d the max config values allowed. (E.g. an issue for 'batch-index-threads' if more than 256 CPUs.)
  • Loading branch information
gooding470 committed Nov 13, 2024
1 parent e32cdcb commit cd6c78a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions as/src/base/batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ as_batch_init()
// Default 'batch-index-threads' can't be set before call to cf_topo_init().
if (g_config.n_batch_index_threads == 0) {
g_config.n_batch_index_threads = cf_topo_count_cpus();

if (g_config.n_batch_index_threads > MAX_BATCH_THREADS) {
g_config.n_batch_index_threads = MAX_BATCH_THREADS;
}
}

cf_info(AS_BATCH, "starting %u batch-index-threads", g_config.n_batch_index_threads);
Expand Down
4 changes: 4 additions & 0 deletions as/src/base/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4029,6 +4029,10 @@ as_config_post_process(as_config* c, const char* config_file)
if (c->n_service_threads == 0) {
c->n_service_threads = c->n_namespaces_not_inlined != 0 ?
n_cpus * 5 : n_cpus;

if (c->n_service_threads > MAX_SERVICE_THREADS) {
c->n_service_threads = MAX_SERVICE_THREADS;
}
}

// Setup performance metrics histograms.
Expand Down

0 comments on commit cd6c78a

Please sign in to comment.