Skip to content

acs-monitor: don't crash on an unhandled MQTT rejection - #749

Merged
AlexGodbehere merged 1 commit into
mainfrom
bug/monitor-crash
Sep 17, 2026
Merged

AlexGodbehere merged 1 commit into
mainfrom
bug/monitor-crash

Conversation

@KavanPrice

Copy link
Copy Markdown
Contributor

Fixes #746.

acs-monitor crash-loops when the MQTT connection drops mid-subscribe. BasicSparkplugNode.on_authenticated() calls mqtt.subscribe(topic) with no callback, and mqtt.js rejects an internal Promise it creates for the pending SUBACK. Our code never sees this, so there's no .catch() for us to attach.

Change

acs-monitor/lib/util.js gains ignore_unhandled_rejections(), wired into both entrypoints right after fplus is built. Logs and continues instead of crashing, matching how a failed cmdescd fetch is already handled one layer up.

@AlexGodbehere
AlexGodbehere merged commit dccc476 into main Sep 17, 2026
2 checks passed
@AlexGodbehere
AlexGodbehere deleted the bug/monitor-crash branch September 17, 2026 08:52
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.

Monitor crashes on unhandled promise rejection

2 participants