From ddbb0df1315227dbc57484f56c9795ebed249181 Mon Sep 17 00:00:00 2001 From: Xavier Vello Date: Mon, 15 Apr 2024 17:13:43 +0200 Subject: [PATCH] chore(p-s): remove unused piscina envvars (#21542) --- plugin-server/src/config/config.ts | 2 -- plugin-server/src/types.ts | 2 -- plugin-server/src/worker/config.ts | 43 ------------------------------ 3 files changed, 47 deletions(-) delete mode 100644 plugin-server/src/worker/config.ts diff --git a/plugin-server/src/config/config.ts b/plugin-server/src/config/config.ts index 1efc0ae9aa3e3..ea51dc1da394d 100644 --- a/plugin-server/src/config/config.ts +++ b/plugin-server/src/config/config.ts @@ -100,8 +100,6 @@ export function getDefaultConfig(): PluginsServerConfig { JOB_QUEUE_S3_PREFIX: '', CRASH_IF_NO_PERSISTENT_JOB_QUEUE: false, HEALTHCHECK_MAX_STALE_SECONDS: 2 * 60 * 60, // 2 hours - PISCINA_USE_ATOMICS: true, - PISCINA_ATOMICS_TIMEOUT: 5000, SITE_URL: null, KAFKA_PARTITIONS_CONSUMED_CONCURRENTLY: 1, CLICKHOUSE_DISABLE_EXTERNAL_SCHEMAS_TEAMS: '', diff --git a/plugin-server/src/types.ts b/plugin-server/src/types.ts index 62f8c2e91ad3f..4d09e06de4ba1 100644 --- a/plugin-server/src/types.ts +++ b/plugin-server/src/types.ts @@ -172,8 +172,6 @@ export interface PluginsServerConfig { JOB_QUEUE_S3_PREFIX: string // S3 filename prefix for the S3 job queue CRASH_IF_NO_PERSISTENT_JOB_QUEUE: boolean // refuse to start unless there is a properly configured persistent job queue (e.g. graphile) HEALTHCHECK_MAX_STALE_SECONDS: number // maximum number of seconds the plugin server can go without ingesting events before the healthcheck fails - PISCINA_USE_ATOMICS: boolean // corresponds to the piscina useAtomics config option (https://github.com/piscinajs/piscina#constructor-new-piscinaoptions) - PISCINA_ATOMICS_TIMEOUT: number // (advanced) corresponds to the length of time a piscina worker should block for when looking for tasks SITE_URL: string | null KAFKA_PARTITIONS_CONSUMED_CONCURRENTLY: number // (advanced) how many kafka partitions the plugin server should consume from concurrently CONVERSION_BUFFER_ENABLED: boolean diff --git a/plugin-server/src/worker/config.ts b/plugin-server/src/worker/config.ts deleted file mode 100644 index d964e4c26c381..0000000000000 --- a/plugin-server/src/worker/config.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { PluginsServerConfig } from '../types' - -// Copy From: node_modules/piscina/src/index.ts -- copied because it's not exported -export interface PiscinaOptions { - filename?: string | null - minThreads?: number - maxThreads?: number - idleTimeout?: number - maxQueue?: number | 'auto' - concurrentTasksPerWorker?: number - useAtomics?: boolean - resourceLimits?: any - argv?: string[] - execArgv?: string[] - env?: any - workerData?: any - niceIncrement?: number - trackUnmanagedFds?: boolean - atomicsTimeout?: number -} - -export function createConfig(serverConfig: PluginsServerConfig, filename: string): PiscinaOptions { - const config: PiscinaOptions = { - filename, - workerData: { serverConfig }, - resourceLimits: { - stackSizeMb: 10, - }, - useAtomics: serverConfig.PISCINA_USE_ATOMICS, - atomicsTimeout: serverConfig.PISCINA_ATOMICS_TIMEOUT, - } - - if (serverConfig.WORKER_CONCURRENCY && serverConfig.WORKER_CONCURRENCY > 0) { - config.minThreads = serverConfig.WORKER_CONCURRENCY - config.maxThreads = serverConfig.WORKER_CONCURRENCY - } - - if (serverConfig.TASKS_PER_WORKER > 1) { - config.concurrentTasksPerWorker = serverConfig.TASKS_PER_WORKER - } - - return config -}