42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
295 stars 60 forks source link

High CPU usage only after session termination #231

Closed jojosoft closed 5 years ago

jojosoft commented 5 years ago

Another cool project! The only problem I am having here is that matterircd starts using up 100 % CPU after I first log out an IRC client. I am aware of #223, but the symptoms seem to be a bit different here. I go through the following steps to reproduce the problem:

Version: 0.19.0 b99916d (linux-386) OS: Linux 4.9.0-8-686-pae SMP Debian 4.9.130-2 (2018-10-27) i686 GNU/Linux Configuration in matterircd.toml:

Debug = false
TLSBind = "0.0.0.0:6697"
PasteBufferTimeout = 2500
[slack]
JoinMpImOnTalk = false
UseDisplayName = false
  1. Execute ./matterircd-linux-386 -conf matterircd.toml -debug
  2. Start a session from irssi or alternatively Revolution IRC (Android)
  3. Run /quit, which immediately causes the high CPU usage

In this state, matterircd is still usable, it is just additionally consuming all CPU ressources. I would maybe look into the code which handles the termination..? The following output is made after initialization:

INFO[2019-02-24T20:26:15+01:00] New connection: ANONYMIZED:26748            module=matterircd
in handshake &irc.Message{Prefix:(*irc.Prefix)(nil), Command:"CAP", Params:[]string{"LS", "302"}, Trailing:"", EmptyTrailing:false}
in handshake &irc.Message{Prefix:(*irc.Prefix)(nil), Command:"PASS", Params:[]string{"ANONYMIZED"}, Trailing:"", EmptyTrailing:false}
in handshake &irc.Message{Prefix:(*irc.Prefix)(nil), Command:"NICK", Params:[]string{"ANONYMIZED"}, Trailing:"", EmptyTrailing:false}
in handshake &irc.Message{Prefix:(*irc.Prefix)(nil), Command:"USER", Params:[]string{"ANONYMIZED", "0", "*"}, Trailing:"ANONYMIZED", EmptyTrailing:false}
1
1
42wim commented 5 years ago

Thanks for reporting, was indeed in the termination code. Fixed now in master.

jojosoft commented 5 years ago

You're welcome, thanks for fixing! Are there nightly builds (linux-386) for matterircd available? (As I don't currently have the toolchain set up...)

furai commented 5 years ago

I've reverted to the older version which doesn't seem to have that issue.

42wim commented 5 years ago

Sorry, I don't have nightly builds (yet), dockerhub has up-to-date builds though. Just released 0.19.1 with the fix.