Idiomatic way to do cancelations

I don’t think it’s automatic like this, but I am not particularly familiar with Ecto (a popular db wrapper in elixir). They might be trapping exits also, or they might be not. If they do, they might cancel the database call on the exit signal from the cowboy process that served the connection.

Doesn’t seem like they do [0].

But I don’t want to misinform you … Maybe someone from the ecto team can provide more insight on how it deals with “dangling” database calls.

There actually was a question about it, but I don’t think anyone came up with a solution at the time [1].

[0] https://github.com/elixir-ecto/ecto/search?utf8=✓&q=trap_exit&type=
[1] Is it possible to stop query execution on db server when process that start to run that query killed?