From 7f67983c2a53d9a5a67c77bd49e4daf538309d31 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 17 Dec 2025 12:16:29 -0300 Subject: [PATCH 1/4] Stop treating 'socket closed at check-in time' as a log-worthy error event and only remove the worker when the pool explicitly gets :closed --- .github/workflows/ci.yml | 1 + lib/split/sockets/pool.ex | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbf7b01..33a5be7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,4 +17,5 @@ jobs: - run: mix deps.unlock --all # compiles and runs tests against latest versions of dependencies - run: mix deps.get - run: mix test + - run: mix format --check-formatted - run: mix dialyzer --format github diff --git a/lib/split/sockets/pool.ex b/lib/split/sockets/pool.ex index add2881..56dda3a 100644 --- a/lib/split/sockets/pool.ex +++ b/lib/split/sockets/pool.ex @@ -139,13 +139,16 @@ defmodule Split.Sockets.Pool do def handle_checkin(checkin, _from, _old_conn, {_opts, metrics_ref} = pool_state) do PoolMetrics.update(metrics_ref, {:connections_in_use, -1}) - with {:ok, conn} <- checkin, - true <- Conn.is_open?(conn) do - {:ok, conn, pool_state} - else - _ -> + case checkin do + {:ok, conn} -> + {:ok, conn, pool_state} + + :closed -> + {:remove, :closed, pool_state} + + other -> Logger.debug( - "Error checking in socket #{inspect(checkin)} to the pool. Socket is closed." + "Error checking in socket #{inspect(other)} to the pool. Socket is closed." ) {:remove, :closed, pool_state} From b7344def9a8e20e735a509f9dcc803cab676ade4 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 17 Dec 2025 12:23:26 -0300 Subject: [PATCH 2/4] Format --- lib/split/sockets/pool.ex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/split/sockets/pool.ex b/lib/split/sockets/pool.ex index 56dda3a..7340d23 100644 --- a/lib/split/sockets/pool.ex +++ b/lib/split/sockets/pool.ex @@ -147,9 +147,7 @@ defmodule Split.Sockets.Pool do {:remove, :closed, pool_state} other -> - Logger.debug( - "Error checking in socket #{inspect(other)} to the pool. Socket is closed." - ) + Logger.debug("Error checking in socket #{inspect(other)} to the pool. Socket is closed.") {:remove, :closed, pool_state} end From 68a545345ebec826d2cd893550df83e878857770 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Wed, 17 Dec 2025 12:37:11 -0300 Subject: [PATCH 3/4] Update CI to test against latest Elixir (1.19.4) and OTP (28). Run format check only on latest version --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33a5be7..a2912a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: # Minimum and maximum supported versions - versions: [{ elixir: '1.14.0', otp: '25' }, { elixir: '1.18.0', otp: '26.2.5' }] + versions: [{ elixir: '1.14.0', otp: '25' }, { elixir: '1.19.4', otp: '28' }] steps: - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 @@ -17,5 +17,6 @@ jobs: - run: mix deps.unlock --all # compiles and runs tests against latest versions of dependencies - run: mix deps.get - run: mix test - - run: mix format --check-formatted + - if: matrix.versions.elixir == '1.19.4' + run: mix format --check-formatted - run: mix dialyzer --format github From e8c63101c317e455d0004a9973626597db3bd673 Mon Sep 17 00:00:00 2001 From: Emiliano Sanchez Date: Thu, 18 Dec 2025 14:17:22 -0300 Subject: [PATCH 4/4] Fix typo --- test/test_helper.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_helper.exs b/test/test_helper.exs index b158c93..2b9b62e 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1,5 +1,5 @@ ExUnit.start() -# supress logging output in the console while testing +# suppress logging output in the console while testing # we can still capture the log output in tests using `capture_log` Logger.configure_backend(:console, level: :error)