Skip to content

Fix Discord crash/hang when exiting immediately after startup #2

@gokr

Description

@gokr

Summary

When Discord integration is enabled, exiting Niffler immediately after startup can either hang during shutdown or crash in the Discord thread before the bot reaches ready state.

Reproduction

  1. Ensure Discord integration is enabled in config/database.
  2. Start ./niffler.
  3. Immediately run /quit.

Observed behavior

  • The process may hang during shutdown.
  • In some runs it crashes in the Discord thread with a SIGSEGV from asyncnet/dimscord startup.
  • If startup is allowed to settle first, shutdown is much more reliable.

Notes

  • Normal shutdown after Discord reaches ready state appears to work.
  • The failure window is specifically the startup phase before the Discord bot is fully ready.
  • The Action refactor work is not the root cause; it only made the quick-exit smoke test expose the existing startup-window bug more consistently.

Current context

Observed while testing around commit 4f13766.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions