mirror of
https://github.com/xcat2/confluent.git
synced 2026-08-28 01:26:44 +00:00
9402df2bdd
The receive loop treated only WSMsgType.CLOSE as the end of a session, but aiohttp reports a peer that has gone away as CLOSED, and it does so immediately and for every subsequent call. Everything that was not CLOSE fell to an else branch that printed a line and went round again, so a console whose bmc restarted became a full speed loop writing one line per iteration: measured at 2.7 million iterations a second, and observed filling 15 GB of log in a quarter of an hour while the daemon stopped answering requests. Treat every message that is not data as the end of the session, clear the connected flag and report the disconnect once. A session that ended any other way than a clean close is recorded in the trace log, unbuffered so that it survives a daemon that does not, rather than printed. Both websocket console plugins carried the same loop. While here, give the openbmc one the parts tsmsol already had: text frames are data rather than a surprise, and the client session is closed when the upgrade fails and when the console does, instead of being leaked.