Skip to content

Releases: general-CbIC/poolex

[1.4.2] Make it more stable

04 Oct 12:13

Choose a tag to compare

What's changed

Changed

  • Improved worker startup handling by returning state alongside worker PID or error, ensuring state consistency during worker creation and handling of failed worker starts. This prevents potential deadlocks when workers fail to start.
  • Refactored worker down handling logic by extracting different scenarios into dedicated functions for better code readability and maintainability.

Fixed

  • Fixed incorrect typespecs in Poolex.Private.IdleOverflowedWorkers.count/1 and Poolex.Private.IdleWorkers.count/1 (changed from neg_integer() to non_neg_integer()).
  • Made Poolex.Private.Monitoring.remove/2 safer by not pattern matching on the Process.demonitor/1 return value.

[1.4.1] Small fixes

29 Jun 09:13

Choose a tag to compare

What's Changed

Fixed

  • Fixed overflow worker expiration timing to use System.monotonic_time/1 instead of Time.utc_now/0. This prevents incorrect worker expiration when system clock changes occur (e.g., from NTP adjustments or timezone changes).
  • Fixed one of the flaky tests.

Full Changelog: v1.4.0...v1.4.1

[1.4.0] Worker shutdown delay support

19 Jun 16:22

Choose a tag to compare

What's Changed

Added

  • New option worker_shutdown_delay for delayed shutdown of overflow workers. Allows to specify a delay (in ms) before terminating overflow workers after they are released. See the new guide for details.
  • New option idle_overflowed_workers_impl for customizing the implementation of idle overflowed workers storage.
  • Strong runtime pool init options validation.

Changed

Breaking changes

  • Function get_debug_info/1 moved from Poolex to Poolex.Private.DebugInfo (according to the issue).
  • Function Poolex.get_state/1 was removed.
  • Minimum required version of Elixir bumped to ~> 1.17 and Erlang/OTP to ~> 25.

Full Changelog: v1.3.0...v1.4.0

[1.3.0] Handle errors on a worker's start

26 Apr 06:30

Choose a tag to compare

What's Changed

Added

  • Added caching of the dependencies on CI (compilation speed up).

  • Added a new option failed_workers_retry_interval to the pool configuration. This option configures the millisecond interval between retry attempts for workers that failed to start. The value is 1 second by default. Example:

    Poolex.start_link(
      worker_module: SomeUnstableWorker,
      workers_count: 5,
      failed_workers_retry_interval: 3_000
    )

Changed

  • Due to the deprecation of support for Ubuntu 20.04 on GitHub Actions (read more here), bumped minimum required versions of Elixir to ~> 1.11 and Erlang/OTP to ~> 24.

Fixed

  • Fixed the MatchError on pool starting error that occurs with errors on the launch of workers (read more in issue).

Full Changelog: v1.2.1...v1.3.0

[1.2.1] Patch with some fixes

06 Apr 08:09

Choose a tag to compare

What's Changed

Fixed

  • Now the busy_worker will be restarted after the caller's death. Read more in issue.
  • The function add_idle_workers!/2 now provides new workers to waiting callers if they exist. Read more in issue.

Full Changelog: v1.2.0...v1.2.1

[1.2.0] `pool_id` fallbacks to `worker_module`

07 Jan 11:26

Choose a tag to compare

What's Changed

Added

  • Added Elixir 1.18.* support to CI.

Changed

  • Refactored tests with new ExUnit parameterize feature.
  • :pool_id is not required init option anymore. For now it is equal to worker_module option value.

Fixed

  • Functions Poolex.add_idle_workers!/2 and Poolex.remove_idle_workers!/2 now accept any value of type GenServer.name() as their first argument, instead of only atom().
  • Supressed Supervisor's error logs in tests.

Full Changelog: v1.1.0...v1.2.0

[1.1.0] Optimized monitoring and other improvements

08 Dec 15:03

Choose a tag to compare

What's Changed

Added

Changed

  • Monitoring implementation has been optimized by using a plain map instead of the Agent process.
  • Refactored State struct by adding a list of @enforced_keys. (Details)
  • Poolex processes now have higher priority. (Details)

Deprecated

  • Poolex.get_state/1 deprecated in favor of :sys.get_state/1.

New Contributors

Full Changelog: v1.0.0...v1.1.0

[1.0.0] Support any `GenServer.name()` as `pool_id`

23 Sep 14:02

Choose a tag to compare

What's changed

Changed

  • Monitoring implementation now uses Agent instead of :ets. It's needed to be more flexible in pool naming.
  • The pool_id can now be any valid GenServer.name(). For example, {:global, :biba} or {:via, Registry, {MyRegistry, "boba"}}.

[0.10.0] Change pool size in runtime

26 Aug 12:21

Choose a tag to compare

What's changed

Added

  • Added functions add_idle_workers!/2 and remove_idle_workers!/2 for changing the count of idle workers in runtime.

Changed

  • Refactored private start_workers function. It no longer accepts monitor_id as it already is in the state.
  • Updated telemetry dependency.

[0.9.0] Pool size metrics

24 Apr 09:01

Choose a tag to compare

What's Changed

Pool size metrics (using telemetry) were added. How to use them is described here: Working with metrics guide.

To enable pool size metrics, you need to set the pool_size_metrics parameter to true on the pool initialization:

children = [
  {Poolex, 
    pool_id: :worker_pool,
    worker_module: SomeWorker,
    workers_count: 5,
    pool_size_metrics: true}
]