airjulio
I’ve been testing how hot updates behave for long running GenServers, but so far, the GenServer process is being killed whenever I upgrade. I have tried setting a higher :shutdown and adding Process.flag(:trap_exit, true) to the init callback function, but still without success.
Some relevant parts of my GenServer:
use GenServer, shutdown: 120 * 1000
@doc false
def start_link(_opts) do
GenServer.start_link(__MODULE__, :ok, name: __MODULE__)
end
def run_testapp do
GenServer.call(__MODULE__, {:run_testapp}, 60 * 1000)
end
@doc false
@impl true
def init(:ok) do
Process.flag(:trap_exit, true)
:ok
end
@doc false
@impl true
def handle_call({:run_testapp}, _from, state) do
Process.sleep(24 * 1000)
{:reply, %{a: 1}, state}
end
Upgrades work fine if the process is not running, but otherwise the running process is killed and I get
** (exit) exited in: GenServer.call(Testapp.Server, {:run_testapp}, 60000)
** (EXIT) killed
(elixir 1.10.0) lib/gen_server.ex:1023: GenServer.call/3
iex(app@127.0.0.1)5> Testapp.Server.run_testapp
Any ideas or resources that could help me?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
gregvaughn
At a low level module replacement only happens when you refer to the module explicitly. For example, calling
MyModule.do_the_thingvs. callingdo_the_thingfrom within MyModule. The first will cause a lookup in the code server for the latest version of MyModule. The latter will not.Further, BEAM only allows 2 versions of one module to co-exist. If one module update happens, but some processes never call the fully qualified name before yet another version is deployed, then those processes are killed. That’s what sounds like is happening to you.