Skip to content

[Qupyter] Unloading cog sometimes hangs the bot forever on socket terminating #28

@Jackenmen

Description

@Jackenmen

Relevant warning:

[2020-09-17 00:01:43] [WARNING] discord.gateway: Shard ID 0 heartbeat blocked for more than 10 seconds.
Loop thread traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/__main__.py", line 548, in <module>
    main()
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/__main__.py", line 511, in main
    loop.run_forever()
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/client.py", line 312, in _run_event
    await coro(*args, **kwargs)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/core/events.py", line 309, in on_message
    await bot.process_commands(message)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/core/bot.py", line 1066, in process_commands
    await self.invoke(ctx)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 903, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/core/commands/commands.py", line 825, in invoke
    await super().invoke(ctx)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1307, in invoke
    await ctx.invoked_subcommand.invoke(ctx)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 855, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/cogs/downloader/downloader.py", line 812, in _cog_unin>
    ctx.bot.unload_extension(real_name)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 694, in unload_extension
    self._remove_module_references(lib.__name__)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 565, in _remove_module_ref>
    self.remove_cog(cogname)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/redbot/core/bot.py", line 1127, in remove_cog
    super().remove_cog(cogname)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 551, in remove_cog
    cog._eject(self)
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/discord/ext/commands/cog.py", line 424, in _eject
    self.cog_unload()
  File "/home/ubuntu/red-data/cogs/CogManager/cogs/qupyter/qupyter.py", line 56, in cog_unload
    self.stop_app()
  File "/home/ubuntu/red-data/cogs/CogManager/cogs/qupyter/qupyter.py", line 81, in stop_app
    self.app.close()
  File "/home/ubuntu/red-data/cogs/CogManager/cogs/qupyter/ipykernel_utils.py", line 290, in close
    super().close()
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/ipykernel/kernelapp.py", line 333, in close
    self.context.term()
  File "/home/ubuntu/red-venv/lib/python3.8/site-packages/zmq/sugar/context.py", line 154, in term
    return super(Context, self).term()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions