Skip to content

fix: avoid race condition with queue termination#126

Merged
Annopaolo merged 1 commit intoastarte-platform:release-1.2from
noaccOS:push-loosoqqotrrm
Mar 16, 2026
Merged

fix: avoid race condition with queue termination#126
Annopaolo merged 1 commit intoastarte-platform:release-1.2from
noaccOS:push-loosoqqotrrm

Conversation

@noaccOS
Copy link
Copy Markdown
Collaborator

@noaccOS noaccOS commented Mar 13, 2026

as under the hood we're calling vernemq's queue, it may happen that we enter a race condition with the process' termination from other sources, such as the device being disconnected

this issue was encountered in astarte's ci, where we disconnect the device right before starting the device deletion

the catch is very conservative, in pracice the error was in the form {:normal, _} in astarte's ci, but in theory all normal exit statuses account for an :ok device disconnection. better safe than sorry

as under the hood we're `call`ing vernemq's queue, it may happen
that we enter a race condition with the process' termination
from other sources, such as the device being disconnected

this issue was encountered in astarte's ci, where we disconnect the
device right before starting the device deletion

the `catch` is very conservative, in pracice the error was in the
form `{:normal, _}` in astarte's ci, but in theory all `normal` exit
statuses account for an `:ok` device disconnection. better safe than
sorry

Signed-off-by: Francesco Noacco <francesco.noacco@secomind.com>
@noaccOS noaccOS requested review from a team, Annopaolo and nedimtokic and removed request for a team March 13, 2026 15:47
@Annopaolo Annopaolo merged commit df38d63 into astarte-platform:release-1.2 Mar 16, 2026
4 checks passed
@noaccOS noaccOS deleted the push-loosoqqotrrm branch March 16, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants