effect icon indicating copy to clipboard operation
effect copied to clipboard

Browser worker are not terminated properly according to `minSize`, `maxSize`, `timeToLive`

Open schickling opened this issue 1 year ago • 0 comments

What version of Effect is running?

3.1

What steps can reproduce the bug?

Set up a browser worker pool similar to this:

  const pool = yield* Worker.makePoolSerialized({
    minSize: 1,
    maxSize: Math.min(3, Math.ceil(navigator.hardwareConcurrency / 2)),
    timeToLive: Duration.seconds(10),
  })

What is the expected behavior?

The worker pool should gracefully shutting down and then terminating each worker until minSize is reached.

What do you see instead?

After more than 10 seconds, there are still the maxSize numbers of workers alive.

Additional information

No response

schickling avatar May 11 '24 12:05 schickling