Ash.Actions.Read.AsyncLimiter - Process is not alive or there`s no process .....

Hi! I am at a loss here with trying to debug the origin of this error. Everything works when I perform a normal Ash.read, but as soon as I use Ash.page I get the following error. Any ideas where I can start to look to find the reason for this error? I have the latest version of Ash, 3.5.24
11:02:33.095: [error] GenServer #PID<0.8303.0> terminating
** (stop) exited in: GenServer.call(#PID<0.8310.0>, {:get_and_update, #Function<0.88285443/1 in Ash.Actions.Read.AsyncLimiter.async_or_inline/4>}, 5000)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(elixir 1.18.3) lib/gen_server.ex:1128: GenServer.call/3
(ash 3.5.24) lib/ash/actions/read/async_limiter.ex:30: Ash.Actions.Read.AsyncLimiter.async_or_inline/4
(ash 3.5.24) lib/ash/actions/read/calculations.ex:401: Ash.Actions.Read.Calculations.do_run_calcs/4
(ash 3.5.24) lib/ash/actions/read/calculations.ex:356: Ash.Actions.Read.Calculations.do_run_calculations/5
(ash 3.5.24) lib/ash/actions/read/read.ex:361: Ash.Actions.Read.do_run/3
(ash 3.5.24) lib/ash/actions/read/read.ex:89: anonymous fn/3 in Ash.Actions.Read.run/3
(ash 3.5.24) lib/ash/actions/read/read.ex:88: Ash.Actions.Read.run/3
(ash 3.5.24) lib/ash.ex:2760: Ash.read/2
(ash 3.5.24) lib/ash.ex:2166: Ash.page!/2
11:02:33.095: [error] GenServer #PID<0.8303.0> terminating
** (stop) exited in: GenServer.call(#PID<0.8310.0>, {:get_and_update, #Function<0.88285443/1 in Ash.Actions.Read.AsyncLimiter.async_or_inline/4>}, 5000)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(elixir 1.18.3) lib/gen_server.ex:1128: GenServer.call/3
(ash 3.5.24) lib/ash/actions/read/async_limiter.ex:30: Ash.Actions.Read.AsyncLimiter.async_or_inline/4
(ash 3.5.24) lib/ash/actions/read/calculations.ex:401: Ash.Actions.Read.Calculations.do_run_calcs/4
(ash 3.5.24) lib/ash/actions/read/calculations.ex:356: Ash.Actions.Read.Calculations.do_run_calculations/5
(ash 3.5.24) lib/ash/actions/read/read.ex:361: Ash.Actions.Read.do_run/3
(ash 3.5.24) lib/ash/actions/read/read.ex:89: anonymous fn/3 in Ash.Actions.Read.run/3
(ash 3.5.24) lib/ash/actions/read/read.ex:88: Ash.Actions.Read.run/3
(ash 3.5.24) lib/ash.ex:2760: Ash.read/2
(ash 3.5.24) lib/ash.ex:2166: Ash.page!/2
7 Replies
ZachDaniel
ZachDaniel•4mo ago
Never seen that before 😅 Can you reproduce it outside of your app?
MortenLund
MortenLundOP•4mo ago
I can try, but I have never seen it myself either.. I removed all the load calls as well since it mentions calculations but no difference.
ZachDaniel
ZachDaniel•4mo ago
The issue may be somewhere in the query context On the returned page there is a rerun Key And maybe it has an async limiter hanging around when it should be cleared
MortenLund
MortenLundOP•4mo ago
Anything I can inspect to indicate this? Add some debug in the action or something?
ZachDaniel
ZachDaniel•4mo ago
You can look at the return value of the first action It will be in the page struct, in the context of the rerun query
MortenLund
MortenLundOP•4mo ago
Your assumption is correct:
%{
count: 142,
offset: 0,
limit: 20,
__struct__: Ash.Page.Offset,
rerun: {%{
combination_of: [],
load: [...],
...,
action: %{...},
context: %{
private: %{
authorize?: true,
actor: %{
roles: [
%{
id: "9793abe6-7368-4d98-9f49-46779e0167e0",
name: "Admin",
parent: nil,
description: "Can perform anything",
key: nil,
...
}
],
api_access: false,
request_id: "0197cabb-51dd-7b56-a1a5-825fedcd939f",
company_id: "4693b13a-0191-45e9-ad2f-a92dd75c90a7",
preferences: %{type: :relationship, field: :preferences, ...},
admin: true,
aggregates: %{},
...
},
async_limiter: #PID<0.2099.0>
}
},
after_action: []
},
...}
%{
count: 142,
offset: 0,
limit: 20,
__struct__: Ash.Page.Offset,
rerun: {%{
combination_of: [],
load: [...],
...,
action: %{...},
context: %{
private: %{
authorize?: true,
actor: %{
roles: [
%{
id: "9793abe6-7368-4d98-9f49-46779e0167e0",
name: "Admin",
parent: nil,
description: "Can perform anything",
key: nil,
...
}
],
api_access: false,
request_id: "0197cabb-51dd-7b56-a1a5-825fedcd939f",
company_id: "4693b13a-0191-45e9-ad2f-a92dd75c90a7",
preferences: %{type: :relationship, field: :preferences, ...},
admin: true,
aggregates: %{},
...
},
async_limiter: #PID<0.2099.0>
}
},
after_action: []
},
...}
This is the same PID that the error shows as well, PID<0.2099.0
12:46:58.975: [error] GenServer #PID<0.2092.0> terminating
** (stop) exited in: GenServer.call(#PID<0.2099.0>, {:get_and_update, #Function<0.88285443/1 in Ash.Actions.Read.AsyncLimiter.async_or_inline/4>}, 5000)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(elixir 1.18.3) lib/gen_server.ex:1128: GenServer.call/3
12:46:58.975: [error] GenServer #PID<0.2092.0> terminating
** (stop) exited in: GenServer.call(#PID<0.2099.0>, {:get_and_update, #Function<0.88285443/1 in Ash.Actions.Read.AsyncLimiter.async_or_inline/4>}, 5000)
** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
(elixir 1.18.3) lib/gen_server.ex:1128: GenServer.call/3
ZachDaniel
ZachDaniel•4mo ago
Okay, we need to make sure we're clearing the async limiter on the query context that we return there Please open an issue

Did you find this page helpful?