46. [`--asn1-decode-max-stack`](#--asn1-decode-max-stack)
47. [`--stale-repository-period`](#--stale-repository-period)
48. [`--thread-pool.server.max`](#--thread-poolservermax)
- 49. [`--thread-pool.validation.max`](#--thread-poolvalidationmax)
50. [`--rsync.enabled`](#--rsyncenabled)
51. [`--rsync.priority`](#--rsyncpriority)
52. [`--rsync.strategy`](#--rsyncstrategy)
5. [`--rrdp.retry.interval`](#--rrdpretryinterval)
60. [`init-locations`](#init-locations)
41. [`--http.idle-timeout`](#--httpidle-timeout)
+ 49. [`--thread-pool.validation.max`](#--thread-poolvalidationmax)
## Syntax
> Before Fort 1.5.1, this value used to represent the maximum number of client _connections_ the server would be able to hold at any given time. It scales better now.
-### `--thread-pool.validation.max`
-
-- **Type:** Integer
-- **Availability:** `argv` and JSON
-- **Default:** 5
-- **Range:** 1--100
-
->  Deprecated. This value should always equal the number of TALs you have, and will therefore be automated and retired in the future.
-
-Number of threads in the validation thread pool.
-
-During every validation cycle, one thread is borrowed from this pool per TAL, to validate the RPKI tree of the corresponding TAL.
-
### `--rsync.enabled`
- **Type:** Boolean (`true`, `false`)
- **Range:** 0--[`UINT_MAX`](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html)
Deprecated alias for [`--http.low-speed-time`](#--httplow-speed-time).
+
+### `--thread-pool.validation.max`
+
+- **Type:** Integer
+- **Availability:** `argv` and JSON
+- **Default:** 5
+- **Range:** 1--100
+
+>  This argument **is DEPRECATED**.
+
+Does nothing as of Fort 1.6.0.
\ No newline at end of file
} server;
/* Threads related to validation cycles */
struct {
- unsigned int max;
+ unsigned int max; /* Deprecated */
} validation;
} thread_pool;
};
.type = >_uint,
.offset = offsetof(struct rpki_config,
thread_pool.validation.max),
- .doc = "Number of threads in the validation thread pool. (Each thread handles one TAL tree.)",
+ .doc = "Deprecated; does nothing.",
+ .deprecated = true,
.min = 0,
.max = 100,
},
return rpki_config.thread_pool.server.max;
}
-unsigned int
-config_get_thread_pool_validation_max(void)
-{
- return rpki_config.thread_pool.validation.max;
-}
-
void
config_set_rsync_enabled(bool value)
{
enum output_format config_get_output_format(void);
unsigned int config_get_asn1_decode_max_stack(void);
unsigned int config_get_thread_pool_server_max(void);
-unsigned int config_get_thread_pool_validation_max(void);
/* Logging getters */
bool config_get_op_log_enabled(void);
};
struct validation_thread {
+ pthread_t pid;
+
/* TAL file name */
char *tal_file;
/*
SLIST_HEAD(threads_list, validation_thread);
struct tal_param {
- struct thread_pool *pool;
struct db_table *db;
struct threads_list threads;
};
return error;
}
-static void
-do_file_validation(void *thread_arg)
+static void *
+do_file_validation(void *arg)
{
- struct validation_thread *thread = thread_arg;
+ struct validation_thread *thread = arg;
struct tal *tal;
int error;
end:
fnstack_cleanup();
thread->exit_status = error;
+ return NULL;
}
static void
{
struct tal_param *t_param = arg;
struct validation_thread *thread;
+ int error;
thread = pmalloc(sizeof(struct validation_thread));
thread->retry_local = true;
thread->sync_files = true;
- thread_pool_push(t_param->pool, thread->tal_file, do_file_validation,
- thread);
+ error = pthread_create(&thread->pid, NULL, do_file_validation, thread);
+ if (error) {
+ pr_op_err("Could not spawn the file validation thread: %s",
+ strerror(error));
+ free(thread->tal_file);
+ free(thread);
+ return error;
+ }
+
SLIST_INSERT_HEAD(&t_param->threads, thread, next);
return 0;
}
int
-perform_standalone_validation(struct thread_pool *pool, struct db_table *table)
+perform_standalone_validation(struct db_table *table)
{
struct tal_param param;
struct validation_thread *thread;
int error;
- param.pool = pool;
param.db = table;
SLIST_INIT(¶m.threads);
}
/* Wait for all */
- thread_pool_wait(pool);
-
while (!SLIST_EMPTY(¶m.threads)) {
thread = SLIST_FIRST(¶m.threads);
+ error = pthread_join(thread->pid, NULL);
+ if (error)
+ pr_crit("pthread_join() threw %d on the '%s' thread.",
+ error, thread->tal_file);
SLIST_REMOVE_HEAD(¶m.threads, next);
if (thread->exit_status) {
error = thread->exit_status;
#include "types/uri.h"
#include "rtr/db/db_table.h"
-#include "thread/thread_pool.h"
struct tal;
char const *tal_get_file_name(struct tal *);
void tal_get_spki(struct tal *, unsigned char const **, size_t *);
-int perform_standalone_validation(struct thread_pool *, struct db_table *);
+int perform_standalone_validation(struct db_table *);
#endif /* TAL_OBJECT_H_ */
#include "rtr/rtr.h"
#include "rtr/db/db_table.h"
#include "slurm/slurm_loader.h"
-#include "thread/thread_pool.h"
#include "cache/local_cache.h"
struct vrp_node {
static struct state state;
-/* Thread pool to use when the TALs will be processed */
-static struct thread_pool *pool;
-
/** Protects @state.base, @state.deltas and @state.serial. */
static pthread_rwlock_t state_lock;
time_t now;
int error;
- pool = NULL;
- error = thread_pool_create("Validation",
- config_get_thread_pool_validation_max(), &pool);
- if (error)
- return error;
-
state.base = NULL;
state.deltas = darray_create();
revert_deltas:
darray_destroy(state.deltas);
- thread_pool_destroy(pool);
return error;
}
void
vrps_destroy(void)
{
- thread_pool_destroy(pool);
-
pthread_rwlock_destroy(&state_lock);
if (state.slurm != NULL)
db = db_table_create();
- error = perform_standalone_validation(pool, db);
+ error = perform_standalone_validation(db);
if (error) {
db_table_destroy(db);
return error;