Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/ecto/adapters/sql/sandbox.ex
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ defmodule Ecto.Adapters.SQL.Sandbox do

{:ok, pid} =
Agent.start(fn ->
set_label({__MODULE__, :sandbox_owner, %{started_by: parent}})
{shared, opts} = Keyword.pop(opts, :shared, false)
:ok = checkout(repo, opts)

Expand Down Expand Up @@ -702,4 +703,12 @@ defmodule Ecto.Adapters.SQL.Sandbox do
defp pre_checkin(_, Connection, {conn_mod, conn_state, _in_transaction?}, _opts) do
{:ok, conn_mod, conn_state}
end

defp set_label(label) do
if function_exported?(Process, :set_label, 1) do
Process.set_label(label)
Copy link
Contributor Author

@nathanl nathanl Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end

:ok
end
end
Loading