Current section

53 Versions

Jump to

Compare versions

17 files changed
+18 additions
-1001 deletions
  @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 7
8 + ## [0.2.1] - 2025-07-20
9 +
10 + ### Fixed
11 + - Eliminated "unexpected message" logs in Pool module by properly handling Task completion messages from `Task.Supervisor.async_nolink`
12 +
8 13 ## [0.2.0] - 2025-07-19
9 14
10 15 ### Added
  @@ -42,7 +42,7 @@ Snakepit is a battle-tested Elixir library that provides a robust pooling system
42 42 # In your mix.exs
43 43 def deps do
44 44 [
45 - {:snakepit, "~> 0.2.0"}
45 + {:snakepit, "~> 0.2.1"}
46 46 ]
47 47 end
48 48
  @@ -68,7 +68,7 @@ Application.put_env(:snakepit, :pool_config, %{pool_size: 4})
68 68 ```elixir
69 69 def deps do
70 70 [
71 - {:snakepit, "~> 0.2.0"}
71 + {:snakepit, "~> 0.2.1"}
72 72 ]
73 73 end
74 74 ```
  @@ -1,6 +1,6 @@
1 1 {<<"links">>,[{<<"GitHub">>,<<"https://github.com/nshkrdotcom/snakepit">>}]}.
2 2 {<<"name">>,<<"snakepit">>}.
3 - {<<"version">>,<<"0.2.0">>}.
3 + {<<"version">>,<<"0.2.1">>}.
4 4 {<<"description">>,
5 5 <<"High-performance pooler and session manager for external language integrations">>}.
6 6 {<<"elixir">>,<<"~> 1.18">>}.
  @@ -8,8 +8,7 @@
8 8 {<<"licenses">>,[<<"MIT">>]}.
9 9 {<<"files">>,
10 10 [<<"lib">>,<<"lib/snakepit.ex">>,<<"lib/snakepit">>,
11 - <<"lib/snakepit/application.ex.bak">>,<<"lib/snakepit/python.ex">>,
12 - <<"lib/snakepit/adapter.ex">>,<<"lib/snakepit/python">>,
11 + <<"lib/snakepit/python.ex">>,<<"lib/snakepit/adapter.ex">>,
13 12 <<"lib/snakepit/utils.ex">>,<<"lib/snakepit/bridge">>,
14 13 <<"lib/snakepit/bridge/protocol.ex">>,<<"lib/snakepit/bridge/session.ex">>,
15 14 <<"lib/snakepit/bridge/session_store.ex">>,
  @@ -28,14 +27,6 @@
28 27 <<"lib/snakepit/adapters/enhanced_python.ex">>,<<"priv">>,<<"priv/python">>,
29 28 <<"priv/python/enhanced_bridge.py">>,
30 29 <<"priv/python/example_custom_bridge_v2.py">>,
31 - <<"priv/python/snakepit_bridge.egg-info">>,
32 - <<"priv/python/snakepit_bridge.egg-info/PKG-INFO">>,
33 - <<"priv/python/snakepit_bridge.egg-info/top_level.txt">>,
34 - <<"priv/python/snakepit_bridge.egg-info/SOURCES.txt">>,
35 - <<"priv/python/snakepit_bridge.egg-info/dependency_links.txt">>,
36 - <<"priv/python/snakepit_bridge.egg-info/requires.txt">>,
37 - <<"priv/python/snakepit_bridge.egg-info/entry_points.txt">>,
38 - <<"priv/python/snakepit_bridge.egg-info/not-zip-safe">>,
39 30 <<"priv/python/generic_bridge.py">>,
40 31 <<"priv/python/example_custom_bridge.py">>,<<"priv/python/setup.py">>,
41 32 <<"priv/python/generic_bridge_v2.py">>,<<"priv/python/snakepit_bridge">>,
  @@ -1,52 +0,0 @@
1 - defmodule Snakepit.Application do
2 - @moduledoc """
3 - Application supervisor for Snakepit pooler.
4 -
5 - Starts the core infrastructure:
6 - - Registry for worker process registration
7 - - ProcessRegistry for Python PID tracking
8 - - SessionStore for session management
9 - - WorkerSupervisor for managing worker processes
10 - - Pool manager for request distribution
11 - """
12 -
13 - use Application
14 - require Logger
15 -
16 - @impl true
17 - def start(_type, _args) do
18 - # Check if pooling is enabled (default: false to prevent auto-start issues)
19 - pooling_enabled = Application.get_env(:snakepit, :pooling_enabled, false)
20 -
21 - children =
22 - if pooling_enabled do
23 - pool_config = Application.get_env(:snakepit, :pool_config, %{})
24 - pool_size = Map.get(pool_config, :pool_size, System.schedulers_online() * 2)
25 -
26 - Logger.info("🚀 Starting Snakepit with pooling enabled (size: #{pool_size})")
27 -
28 - [
29 - # Registry for worker process registration
30 - Snakepit.Pool.Registry,
31 -
32 - # Process registry for Python PID tracking
33 - Snakepit.Pool.ProcessRegistry,
34 -
35 - # Session store for session management
36 - Snakepit.Bridge.SessionStore,
37 -
38 - # Worker supervisor for managing worker processes
39 - Snakepit.Pool.WorkerSupervisor,
40 -
41 - # Main pool manager
42 - {Snakepit.Pool, [size: pool_size]}
43 - ]
44 - else
45 - Logger.info("🔧 Starting Snakepit with pooling disabled")
46 - []
47 - end
48 -
49 - opts = [strategy: :one_for_one, name: Snakepit.Supervisor]
50 - Supervisor.start_link(children, opts)
51 - end
52 - end
  @@ -305,6 +305,14 @@ defmodule Snakepit.Pool do
305 305 end
306 306 end
307 307
308 + @doc false
309 + # Handles completion messages from tasks started via Task.Supervisor.async_nolink.
310 + # These are used for fire-and-forget operations (like replying to callers or
311 + # kicking off worker respawns), so we can safely ignore the completion message.
312 + def handle_info({ref, _result}, state) when is_reference(ref) do
313 + {:noreply, state}
314 + end
315 +
308 316 def handle_info(msg, state) do
309 317 Logger.debug("Pool received unexpected message: #{inspect(msg)}")
310 318 {:noreply, state}
Loading more files…