Merge branch 'master' into add-worker-test
authorShinigami92 <chrissi92@hotmail.de>
Tue, 16 Feb 2021 15:08:46 +0000 (16:08 +0100)
committerShinigami92 <chrissi92@hotmail.de>
Tue, 16 Feb 2021 15:08:46 +0000 (16:08 +0100)
17 files changed:
1  2 
package.json
tests/pools/abstract/abstract-pool.test.js
tests/pools/cluster/dynamic.test.js
tests/pools/cluster/fixed.test.js
tests/pools/thread/dynamic.test.js
tests/pools/thread/fixed.test.js
tests/worker-files/cluster/asyncErrorWorker.js
tests/worker-files/cluster/asyncWorker.js
tests/worker-files/cluster/echoWorker.js
tests/worker-files/cluster/emptyWorker.js
tests/worker-files/cluster/errorWorker.js
tests/worker-files/cluster/testWorker.js
tests/worker-files/thread/asyncWorker.js
tests/worker-files/thread/echoWorker.js
tests/worker-files/thread/emptyWorker.js
tests/worker-files/thread/errorWorker.js
tests/worker-files/thread/testWorker.js

diff --combined package.json
index fdba3a8b9ab5df262d49dd37d4b90e480423d72b,3831b17b3d74e482b878ed480dc335ead05cb48c..daf3df0e441da1499e58b8ff9fa1c7dcc0191965
@@@ -4,14 -4,14 +4,14 @@@
    "description": "Library on top of node js worker threads that implement various worker pools type",
    "main": "lib/index.js",
    "scripts": {
-     "build": "rollup --config",
-     "build:dev": "rollup --config --environment BUILD:development",
-     "benchmark": "npm run build && node benchmarks/bench.js",
-     "benchmark:debug": "npm run build:dev && node -r source-map-support/register --inspect-brk benchmarks/bench.js",
-     "benchmark:debug:vscode": "node -r source-map-support/register benchmarks/bench.js",
-     "test": "npm run build && nyc mocha --exit --timeout 20000 'tests/**/*.test.js'",
-     "test:debug": "npm run build:dev && mocha -r source-map-support/register --inspect-brk --exit 'tests/**/*.test.js'",
-     "test:debug:vscode": "mocha -r source-map-support/register --exit 'tests/**/*.test.js'",
+     "build": "rollup --config --environment BUILD:development",
+     "build:prod": "rollup --config",
+     "benchmark": "npm run build && node -r source-map-support/register benchmarks/bench.js",
+     "benchmark:debug": "npm run build && node -r source-map-support/register --inspect benchmarks/bench.js",
+     "benchmark:prod": "npm run build:prod && node -r source-map-support/register benchmarks/bench.js",
 -    "test": "npm run build && nyc mocha -r source-map-support/register --exit --timeout 20000 tests/**/*.test.js",
 -    "test:debug": "npm run build && mocha -r source-map-support/register --inspect --exit --timeout 20000 tests/**/*.test.js",
 -    "test:prod": "npm run build:prod && nyc mocha -r source-map-support/register --exit --timeout 20000 tests/**/*.test.js",
++    "test": "npm run build && nyc mocha -r source-map-support/register --exit --timeout 20000 'tests/**/*.test.js'",
++    "test:debug": "npm run build && mocha -r source-map-support/register --inspect --exit --timeout 20000 'tests/**/*.test.js'",
++    "test:prod": "npm run build:prod && nyc mocha -r source-map-support/register --exit --timeout 20000 'tests/**/*.test.js'",
      "sonar": "sonar-scanner",
      "coverage": "nyc report --reporter=lcov --check-coverage --lines 80",
      "coverage:html": "nyc report --reporter=html --check-coverage --lines 80",
      "lib"
    ],
    "devDependencies": {
-     "@types/node": "^14.14.27",
-     "@typescript-eslint/eslint-plugin": "^4.15.0",
-     "@typescript-eslint/parser": "^4.15.0",
+     "@types/node": "^14.14.28",
+     "@typescript-eslint/eslint-plugin": "^4.15.1",
+     "@typescript-eslint/parser": "^4.15.1",
      "benchmark": "^2.1.4",
      "eslint": "^7.20.0",
      "eslint-config-standard": "^16.0.2",
      "eslint-plugin-import": "^2.22.1",
-     "eslint-plugin-jsdoc": "^31.6.1",
+     "eslint-plugin-jsdoc": "^32.0.1",
      "eslint-plugin-node": "^11.1.0",
      "eslint-plugin-prettierx": "^0.17.1",
      "eslint-plugin-promise": "^4.3.1",
index 0000000000000000000000000000000000000000,d5d87058ed2c7f1f2f24c9a18347f00199f146f3..65d667f141a7cefccaf64e5de6525c77a0d37d2b
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,55 +1,55 @@@
 -      './tests/worker/cluster/testWorker.js',
+ const expect = require('expect')
+ const { FixedThreadPool } = require('../../../lib/index')
+ const expectedError = new Error('Worker could not be found in tasks map')
+ class StubPoolWithTasksMapClear extends FixedThreadPool {
+   removeAllWorker () {
+     this.tasks.clear()
+   }
+ }
+ class StubPoolWithIsMainMethod extends FixedThreadPool {
+   isMain () {
+     return false
+   }
+ }
+ describe('Abstract pool test suite ', () => {
+   it('Simulate worker not found during increaseWorkersTask', () => {
+     const pool = new StubPoolWithTasksMapClear(
+       1,
 -      './tests/worker/cluster/testWorker.js',
++      './tests/worker-files/cluster/testWorker.js',
+       {
+         errorHandler: e => console.error(e)
+       }
+     )
+     // simulate worker not found.
+     pool.removeAllWorker()
+     expect(() => pool.increaseWorkersTask()).toThrowError(expectedError)
+   })
+   it('Simulate worker not found during decreaseWorkersTasks', () => {
+     const pool = new StubPoolWithTasksMapClear(
+       1,
 -        './tests/worker/cluster/testWorker.js',
++      './tests/worker-files/cluster/testWorker.js',
+       {
+         errorHandler: e => console.error(e)
+       }
+     )
+     // simulate worker not found.
+     pool.removeAllWorker()
+     expect(() => pool.decreaseWorkersTasks()).toThrowError(expectedError)
+   })
+   it('Simulate pool creation from a non main thread/process', () => {
+     expect(() => {
+       const pool = new StubPoolWithIsMainMethod(
+         1,
++        './tests/worker-files/cluster/testWorker.js',
+         {
+           errorHandler: e => console.error(e)
+         }
+       )
+     }).toThrowError()
+   })
+ })
index 36d17d8695f37c4698a294b7e66b2f28a4beb4a3,b45b7ccac91308fcb1fe5193f0ffa3ea8d882b60..01b720720ac4761a768645b329d3cdb00a93283e
@@@ -5,10 -5,9 +5,9 @@@ const max = 
  const pool = new DynamicClusterPool(
    min,
    max,
 -  './tests/worker/cluster/testWorker.js',
 +  './tests/worker-files/cluster/testWorker.js',
    {
-     errorHandler: e => console.error(e),
-     onlineHandler: () => console.log('worker is online')
+     errorHandler: e => console.error(e)
    }
  )
  
@@@ -51,7 -50,7 +50,7 @@@ describe('Dynamic cluster pool test sui
        pool.execute({ test: 'test' })
      }
      expect(pool.workers.length).toBeGreaterThan(min)
-     await new Promise(resolve => setTimeout(resolve, 2000))
+     await new Promise(resolve => setTimeout(resolve, 3000))
      expect(pool.workers.length).toBe(min)
    })
    it('Shutdown test', async () => {
@@@ -62,7 -61,7 +61,7 @@@
        })
      })
      pool.destroy()
-     await new Promise(resolve => setTimeout(resolve, 1000))
+     await new Promise(resolve => setTimeout(resolve, 2000))
      expect(closedWorkers).toBe(min)
    })
  
      const pool1 = new DynamicClusterPool(
        1,
        1,
 -      './tests/worker/cluster/testWorker.js'
 +      './tests/worker-files/cluster/testWorker.js'
      )
      const res = await pool1.execute({ test: 'test' })
      expect(res).toBeFalsy()
    })
+   it('Verify scale processes up and down is working when long running task is used:hard', async () => {
+     const longRunningPool = new DynamicClusterPool(
+       min,
+       max,
+       './tests/worker/cluster/longRunningWorkerHardBehavior.js'
+     )
+     expect(longRunningPool.workers.length).toBe(min)
+     for (let i = 0; i < max * 10; i++) {
+       longRunningPool.execute({ test: 'test' })
+     }
+     expect(longRunningPool.workers.length).toBe(max)
+     await new Promise(resolve => setTimeout(resolve, 3000))
+     // Here we expect the workers to be at the max size since that the task is still running
+     expect(longRunningPool.workers.length).toBe(min)
+   })
+   it('Verify scale processes up and down is working when long running task is used:soft', async () => {
+     const longRunningPool = new DynamicClusterPool(
+       min,
+       max,
+       './tests/worker/cluster/longRunningWorkerSoftBehavior.js'
+     )
+     expect(longRunningPool.workers.length).toBe(min)
+     for (let i = 0; i < max * 10; i++) {
+       longRunningPool.execute({ test: 'test' })
+     }
+     expect(longRunningPool.workers.length).toBe(max)
+     await new Promise(resolve => setTimeout(resolve, 3000))
+     // Here we expect the workers to be at the max size since that the task is still running
+     expect(longRunningPool.workers.length).toBe(max)
+   })
  })
index 1cbfadf5b63ad3e029b61d47e24f6d6d9a445467,87f7376ceb7d18fb8c9f5e676a264af53a5ea4cf..f5300eccf424c39028e340296b18d1d0492f45f4
@@@ -4,39 -4,34 +4,37 @@@ const numberOfWorkers = 1
  const maxTasks = 500
  const pool = new FixedClusterPool(
    numberOfWorkers,
 -  './tests/worker/cluster/testWorker.js',
 +  './tests/worker-files/cluster/testWorker.js',
    {
-     errorHandler: e => console.error(e),
-     onlineHandler: () => console.log('worker is online')
+     errorHandler: e => console.error(e)
    }
  )
  const emptyPool = new FixedClusterPool(
    1,
 -  './tests/worker/cluster/emptyWorker.js'
 +  './tests/worker-files/cluster/emptyWorker.js'
 +)
 +const echoPool = new FixedClusterPool(
 +  1,
 +  './tests/worker-files/cluster/echoWorker.js'
  )
 -const echoPool = new FixedClusterPool(1, './tests/worker/cluster/echoWorker.js')
  const errorPool = new FixedClusterPool(
    1,
 -  './tests/worker/cluster/errorWorker.js',
 +  './tests/worker-files/cluster/errorWorker.js',
    {
-     errorHandler: e => console.error(e),
-     onlineHandler: () => console.log('worker is online')
+     errorHandler: e => console.error(e)
    }
  )
  
  const asyncErrorPool = new FixedClusterPool(
    1,
 -  './tests/worker/cluster/asyncErrorWorker.js',
 +  './tests/worker-files/cluster/asyncErrorWorker.js',
    {
      onlineHandler: () => console.log('worker is online')
    }
  )
  const asyncPool = new FixedClusterPool(
    1,
 -  './tests/worker/cluster/asyncWorker.js',
 +  './tests/worker-files/cluster/asyncWorker.js',
    {
      maxTasks: maxTasks
    }
@@@ -124,7 -119,7 +122,7 @@@ describe('Fixed cluster pool test suit
        })
      })
      await pool.destroy()
-     await new Promise(resolve => setTimeout(resolve, 200))
+     await new Promise(resolve => setTimeout(resolve, 500))
      expect(closedWorkers).toBe(numberOfWorkers)
    })
  
    it('Should work even without opts in input', async () => {
      const pool1 = new FixedClusterPool(
        1,
 -      './tests/worker/cluster/testWorker.js'
 +      './tests/worker-files/cluster/testWorker.js'
      )
      const res = await pool1.execute({ test: 'test' })
      expect(res).toBeFalsy()
index 5f6dc8ba47cb92fe26aefc82a767dd2acaa2ec9b,107ca8665d56ac5e57134ac9be2bede7e7063d6c..4efb0f4b83bdad12b0d96e83d6276ab773198eda
@@@ -5,10 -5,9 +5,9 @@@ const max = 
  const pool = new DynamicThreadPool(
    min,
    max,
 -  './tests/worker/thread/testWorker.js',
 +  './tests/worker-files/thread/testWorker.js',
    {
-     errorHandler: e => console.error(e),
-     onlineHandler: () => console.log('worker is online')
+     errorHandler: e => console.error(e)
    }
  )
  
@@@ -50,9 -49,10 +49,10 @@@ describe('Dynamic thread pool test suit
        pool.execute({ test: 'test' })
      }
      expect(pool.workers.length).toBe(max)
-     await new Promise(resolve => setTimeout(resolve, 1000))
+     await new Promise(resolve => setTimeout(resolve, 1500))
      expect(pool.workers.length).toBe(min)
    })
    it('Shutdown test', async () => {
      let closedThreads = 0
      pool.workers.forEach(w => {
      const pool1 = new DynamicThreadPool(
        1,
        1,
 -      './tests/worker/thread/testWorker.js'
 +      './tests/worker-files/thread/testWorker.js'
      )
      const res = await pool1.execute({ test: 'test' })
      expect(res).toBeFalsy()
    })
+   it('Verify scale thread up and down is working when long running task is used:hard', async () => {
+     const longRunningPool = new DynamicThreadPool(
+       min,
+       max,
+       './tests/worker/thread/longRunningWorkerHardBehavior.js',
+       {
+         errorHandler: e => console.error(e),
+         onlineHandler: () => console.log('worker is online')
+       }
+     )
+     expect(longRunningPool.workers.length).toBe(min)
+     for (let i = 0; i < max * 10; i++) {
+       longRunningPool.execute({ test: 'test' })
+     }
+     expect(longRunningPool.workers.length).toBe(max)
+     await new Promise(resolve => setTimeout(resolve, 1500))
+     expect(longRunningPool.workers.length).toBe(min)
+   })
+   it('Verify scale thread up and down is working when long running task is used:soft', async () => {
+     const longRunningPool = new DynamicThreadPool(
+       min,
+       max,
+       './tests/worker/thread/longRunningWorkerSoftBehavior.js',
+       {
+         errorHandler: e => console.error(e),
+         onlineHandler: () => console.log('worker is online')
+       }
+     )
+     expect(longRunningPool.workers.length).toBe(min)
+     for (let i = 0; i < max * 10; i++) {
+       longRunningPool.execute({ test: 'test' })
+     }
+     expect(longRunningPool.workers.length).toBe(max)
+     await new Promise(resolve => setTimeout(resolve, 1500))
+     // Here we expect the workers to be at the max size since that the task is still running
+     expect(longRunningPool.workers.length).toBe(max)
+   })
  })
index ff945a700f6bf6efe85359b260499597c3497a1c,e160f17c72b6d4db2e8111d7fed488f84a666610..755ccf4d4fa2aa12b0621344d1010af377431248
@@@ -4,23 -4,16 +4,22 @@@ const numberOfThreads = 1
  const maxTasks = 400
  const pool = new FixedThreadPool(
    numberOfThreads,
 -  './tests/worker/thread/testWorker.js',
 +  './tests/worker-files/thread/testWorker.js',
    {
-     errorHandler: e => console.error(e),
-     onlineHandler: () => console.log('worker is online')
+     errorHandler: e => console.error(e)
    }
  )
 -const emptyPool = new FixedThreadPool(1, './tests/worker/thread/emptyWorker.js')
 -const echoPool = new FixedThreadPool(1, './tests/worker/thread/echoWorker.js')
 +const emptyPool = new FixedThreadPool(
 +  1,
 +  './tests/worker-files/thread/emptyWorker.js'
 +)
 +const echoPool = new FixedThreadPool(
 +  1,
 +  './tests/worker-files/thread/echoWorker.js'
 +)
  const errorPool = new FixedThreadPool(
    1,
 -  './tests/worker/thread/errorWorker.js',
 +  './tests/worker-files/thread/errorWorker.js',
    {
      errorHandler: e => console.error(e),
      onlineHandler: () => console.log('worker is online')
@@@ -28,7 -21,7 +27,7 @@@
  )
  const asyncPool = new FixedThreadPool(
    1,
 -  './tests/worker/thread/asyncWorker.js',
 +  './tests/worker-files/thread/asyncWorker.js',
    { maxTasks: maxTasks }
  )
  
@@@ -117,10 -110,7 +116,10 @@@ describe('Fixed thread pool test suite 
    })
  
    it('Should work even without opts in input', async () => {
 -    const pool1 = new FixedThreadPool(1, './tests/worker/thread/testWorker.js')
 +    const pool1 = new FixedThreadPool(
 +      1,
 +      './tests/worker-files/thread/testWorker.js'
 +    )
      const res = await pool1.execute({ test: 'test' })
      expect(res).toBeFalsy()
    })
index 2476853b55520ab5fea4c917fb70d0f05c66dfa0,b9fd9016ab91801122e4cb6394b5e590377b4f3f..b9fd9016ab91801122e4cb6394b5e590377b4f3f
@@@ -1,5 -1,5 +1,5 @@@
  'use strict'
- const { ClusterWorker } = require('../../../lib/index')
+ const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
  
  async function error (data) {
    return new Promise((resolve, reject) => {
@@@ -12,5 -12,6 +12,6 @@@
  
  module.exports = new ClusterWorker(error, {
    maxInactiveTime: 500,
-   async: true
+   async: true,
+   killBehavior: KillBehaviors.HARD
  })
index 975b0b365efb92dad4d24f44a20434f1267a4cd4,b5c784dfaca6b7491b25914ceefa81a94042c44f..b5c784dfaca6b7491b25914ceefa81a94042c44f
@@@ -1,5 -1,5 +1,5 @@@
  'use strict'
- const { ClusterWorker } = require('../../../lib/index')
+ const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
  
  async function sleep (data) {
    return new Promise((resolve, reject) => {
@@@ -7,4 -7,8 +7,8 @@@
    })
  }
  
- module.exports = new ClusterWorker(sleep, { maxInactiveTime: 500, async: true })
+ module.exports = new ClusterWorker(sleep, {
+   maxInactiveTime: 500,
+   async: true,
+   killBehavior: KillBehaviors.HARD
+ })
index 6c77bcce888b77b20f4f6045d4bc3f4fe00905a3,054c4bb30c2d8ef2ad2ed9dd52bc5c6f9af793e2..054c4bb30c2d8ef2ad2ed9dd52bc5c6f9af793e2
@@@ -1,8 -1,11 +1,11 @@@
  'use strict'
- const { ClusterWorker } = require('../../../lib/index')
+ const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
  
  function echo (data) {
    return data
  }
  
- module.exports = new ClusterWorker(echo, { maxInactiveTime: 500 })
+ module.exports = new ClusterWorker(echo, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })
index 62c8e2bb0438e426dd3838101002b53bba20b692,58c55af12b8c171a12c8b430a3b32b3e2d7c0dc5..58c55af12b8c171a12c8b430a3b32b3e2d7c0dc5
@@@ -1,6 -1,9 +1,9 @@@
  'use strict'
- const { ClusterWorker } = require('../../../lib/index')
+ const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
  
  function test (data) {}
  
- module.exports = new ClusterWorker(test, { maxInactiveTime: 500 })
+ module.exports = new ClusterWorker(test, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })
index 87df92543664b6e3c5395a52e8c822d65ea0c8b6,d6d9297ac8e5f671c3249622139c3ba0c8b8d8b6..d6d9297ac8e5f671c3249622139c3ba0c8b8d8b6
@@@ -1,5 -1,5 +1,5 @@@
  'use strict'
- const { ClusterWorker } = require('../../../lib/index')
+ const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
  
  function error (data) {
    throw new Error('Error Message from ClusterWorker')
@@@ -7,5 -7,6 +7,6 @@@
  
  module.exports = new ClusterWorker(error, {
    maxInactiveTime: 500,
-   async: false
+   async: false,
+   killBehavior: KillBehaviors.HARD
  })
index a8a6bb9ee14a0e1e670bb12348dfc47a1590b1b3,7caad9476da291f19319b981c67e8115ac0e32a7..7caad9476da291f19319b981c67e8115ac0e32a7
@@@ -1,5 -1,5 +1,5 @@@
  'use strict'
- const { ClusterWorker } = require('../../../lib/index')
+ const { ClusterWorker, KillBehaviors } = require('../../../lib/index')
  const { isMaster } = require('cluster')
  
  function test (data) {
@@@ -12,4 -12,7 +12,7 @@@
    return isMaster
  }
  
- module.exports = new ClusterWorker(test, { maxInactiveTime: 500 })
+ module.exports = new ClusterWorker(test, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })
index 25401cfb14dea2ff9fed837f138f349218ff7b34,0bf5d244758ce100683ea9c23faf114bd03428c8..0bf5d244758ce100683ea9c23faf114bd03428c8
@@@ -1,5 -1,5 +1,5 @@@
  'use strict'
- const { ThreadWorker } = require('../../../lib/index')
+ const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
  
  async function sleep (data) {
    return new Promise((resolve, reject) => {
@@@ -7,4 -7,8 +7,8 @@@
    })
  }
  
- module.exports = new ThreadWorker(sleep, { maxInactiveTime: 500, async: true })
+ module.exports = new ThreadWorker(sleep, {
+   maxInactiveTime: 500,
+   async: true,
+   killBehavior: KillBehaviors.HARD
+ })
index 006bf97cd390f59f2c5bd37c28a2bfbb307a889b,071428c5bc5f1414b5e61718ccf605826480bf45..071428c5bc5f1414b5e61718ccf605826480bf45
@@@ -1,8 -1,11 +1,11 @@@
  'use strict'
- const { ThreadWorker } = require('../../../lib/index')
+ const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
  
  function echo (data) {
    return data
  }
  
- module.exports = new ThreadWorker(echo, { maxInactiveTime: 500 })
+ module.exports = new ThreadWorker(echo, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })
index 69a83a7710fed25eeae541c9f1b83b737d135664,6a146c2653496f99238945c6648aa1dbe51ab4e2..6a146c2653496f99238945c6648aa1dbe51ab4e2
@@@ -1,6 -1,9 +1,9 @@@
  'use strict'
- const { ThreadWorker } = require('../../../lib/index')
+ const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
  
  function test (data) {}
  
- module.exports = new ThreadWorker(test, { maxInactiveTime: 500 })
+ module.exports = new ThreadWorker(test, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })
index 63a27513a74638aafbfabc08f04c6dec01f46ea9,e9f20ab8e5101120d7f51459bf338676208f404f..e9f20ab8e5101120d7f51459bf338676208f404f
@@@ -1,8 -1,11 +1,11 @@@
  'use strict'
- const { ThreadWorker } = require('../../../lib/index')
+ const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
  
  function error (data) {
    throw new Error(data)
  }
  
- module.exports = new ThreadWorker(error, { maxInactiveTime: 500 })
+ module.exports = new ThreadWorker(error, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })
index 3556da01f8051960125d833ec4b38e7196f6ad94,c70069c7269f17d2f83069554d0e3fba5d2a15e6..c70069c7269f17d2f83069554d0e3fba5d2a15e6
@@@ -1,5 -1,5 +1,5 @@@
  'use strict'
- const { ThreadWorker } = require('../../../lib/index')
+ const { ThreadWorker, KillBehaviors } = require('../../../lib/index')
  const { isMainThread } = require('worker_threads')
  
  function test (data) {
@@@ -12,4 -12,7 +12,7 @@@
    return isMainThread
  }
  
- module.exports = new ThreadWorker(test, { maxInactiveTime: 500 })
+ module.exports = new ThreadWorker(test, {
+   maxInactiveTime: 500,
+   killBehavior: KillBehaviors.HARD
+ })