seisatsu / DennisMUD

Dennis MUD - A multiplayer text adventure sandbox engine where the players build the world with in-game commands.
https://dennismud.xyz/
MIT License
47 stars 6 forks source link

Fix Unhandled Error involving the shutdown command #110

Open seisatsu opened 1 year ago

seisatsu commented 1 year ago

This sometimes happens:


Traceback (most recent call last):
  File "/var/www/dennismud.xyz/Dennis/server.py", line 352, in <module>
    sys.exit(main())
  File "/var/www/dennismud.xyz/Dennis/server.py", line 335, in main
    reactor.run()
  File "/usr/local/lib/python3.9/dist-packages/twisted/internet/base.py", line 1315, in run
    self.mainLoop()
  File "/usr/local/lib/python3.9/dist-packages/twisted/internet/base.py", line 1325, in mainLoop
    reactorBaseSelf.runUntilCurrent()
--- <exception caught here> ---
  File "/usr/local/lib/python3.9/dist-packages/twisted/internet/base.py", line 991, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/usr/local/lib/python3.9/dist-packages/txaio/_common.py", line 136, in _notify_bucket
    notify_one_chunk(calls, self._chunk_size, max(0.0, delay_ms))
  File "/usr/local/lib/python3.9/dist-packages/txaio/_common.py", line 130, in notify_one_chunk
    raise RuntimeError(msg)
builtins.RuntimeError: Error(s) processing call_later bucket:
'NoneType' object has no attribute 'shutdown'```
seisatsu commented 1 year ago

This appears to always start with a connection failure: 2022-12-21T14:21:56.039998-6000 [websocket#info] Client failed to connect: tcp4:172.58.36.26:41506

The traceback error in the first comment occurs when the "failed" client tries to send a command.

seisatsu commented 1 year ago

I shut down the server after seeing this error and tried to start it again, and found that the SSL cert is expired. This is the likely root cause of the connection failures. Something about connection failures is being mishandled.

seisatsu commented 1 year ago

Related to #115.