From 1851f9c98abb3a41bd9cc102e80ab4ebbf893bd3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:47:17 -0700 Subject: [PATCH] [Deprecation] Deprecate setupMaster in favor of setupClusterManager (#1752) (#1769) As part of the meta issue https://github.com/opensearch-project/OpenSearch/issues/2589 to track the plan and progress of applying inclusive naming across OpenSearch Repositories We are deprecating setupMaster in favor of setupClusterManager Signed-off-by: manasvinibs (cherry picked from commit 9e508e70f0103c6fdb26ebc064f623e419443d84) Signed-off-by: Manasvini B Suryanarayana Co-authored-by: Manasvini B Suryanarayana --- src/cli/cluster/cluster.mock.ts | 2 ++ src/cli/cluster/cluster_manager.ts | 2 +- src/cli/cluster/worker.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cli/cluster/cluster.mock.ts b/src/cli/cluster/cluster.mock.ts index fa494128e909..fa153130c096 100644 --- a/src/cli/cluster/cluster.mock.ts +++ b/src/cli/cluster/cluster.mock.ts @@ -78,5 +78,7 @@ class MockClusterFork extends EventEmitter { export class MockCluster extends EventEmitter { fork = jest.fn(() => new MockClusterFork(this)); + /** @deprecated use setupClusterManager */ setupMaster = jest.fn(); + setupClusterManager = jest.fn(); } diff --git a/src/cli/cluster/cluster_manager.ts b/src/cli/cluster/cluster_manager.ts index 7e09a820b249..827628ec6183 100644 --- a/src/cli/cluster/cluster_manager.ts +++ b/src/cli/cluster/cluster_manager.ts @@ -135,7 +135,7 @@ export class ClusterManager { }); // When receive that event from server worker - // forward a reloadLoggingConfig message to master + // forward a reloadLoggingConfig message to cluster manager // and all workers. This is only used by LogRotator service // when the cluster mode is enabled this.server.on('reloadLoggingConfigFromServerWorker', () => { diff --git a/src/cli/cluster/worker.ts b/src/cli/cluster/worker.ts index d69708793b23..19f2c666dc50 100644 --- a/src/cli/cluster/worker.ts +++ b/src/cli/cluster/worker.ts @@ -30,6 +30,7 @@ import _ from 'lodash'; import cluster from 'cluster'; +import { setupMaster as setupClusterManager } from 'cluster'; import { EventEmitter } from 'events'; import { BinderFor } from './binder_for'; @@ -44,7 +45,7 @@ export type ClusterWorker = cluster.Worker & { exitCode?: number; }; -cluster.setupMaster({ +setupClusterManager({ exec: cliPath, silent: false, });