fix channel shutnown exception
This commit is contained in:
parent
4174987a88
commit
38a0681bf7
2 changed files with 13 additions and 3 deletions
|
|
@ -1,3 +1,13 @@
|
|||
2026-02-13
|
||||
fix: prevent agent channel graceful shutdowns from being logged as exceptions
|
||||
- Changed Phoenix Channel stop reasons to use {:shutdown, reason} tuple instead
|
||||
of bare atoms to signal graceful termination
|
||||
- Updated heartbeat_timeout, token_disabled, and restart_requested handlers
|
||||
- Prevents error tracking systems from incorrectly reporting normal agent
|
||||
disconnections as ErlangError exceptions
|
||||
- These events are expected operational occurrences (timeouts, admin actions)
|
||||
- File: lib/towerops_web/channels/agent_channel.ex
|
||||
|
||||
2026-02-12
|
||||
feat: complete migration from DevicePollerWorker to CheckExecutorWorker
|
||||
- Removed all DevicePollerWorker scheduling from device lifecycle
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ defmodule ToweropsWeb.AgentChannel do
|
|||
agent_token_id: socket.assigns.agent_token_id
|
||||
)
|
||||
|
||||
{:stop, :heartbeat_timeout, socket}
|
||||
{:stop, {:shutdown, :heartbeat_timeout}, socket}
|
||||
else
|
||||
Process.send_after(self(), :check_heartbeat, @heartbeat_check_interval_ms)
|
||||
{:noreply, socket}
|
||||
|
|
@ -206,7 +206,7 @@ defmodule ToweropsWeb.AgentChannel do
|
|||
agent_token_id: socket.assigns.agent_token_id
|
||||
)
|
||||
|
||||
{:stop, :token_disabled, socket}
|
||||
{:stop, {:shutdown, :token_disabled}, socket}
|
||||
end
|
||||
|
||||
# Handle restart request — push restart event to agent, then stop channel
|
||||
|
|
@ -216,7 +216,7 @@ defmodule ToweropsWeb.AgentChannel do
|
|||
)
|
||||
|
||||
push(socket, "restart", %{})
|
||||
{:stop, :restart_requested, socket}
|
||||
{:stop, {:shutdown, :restart_requested}, socket}
|
||||
end
|
||||
|
||||
# Handle update request — push update event with download URL and checksum to agent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue