myano / jenni

jenni was a python IRC bot. Project is closed. Try Sopel instead, https://sopel.chat/
https://sopel.chat/
Other
235 stars 101 forks source link

startup: extend the sleep after identify'ing with nickserv to delay join #179

Closed solidgoldbomb closed 9 years ago

solidgoldbomb commented 9 years ago

The IDENTIFY step often takes more than 5s to complete. If the JOINs happen before IDENTIFY completes, the bot's vhost/cloak will not have been applied prior to the JOINs being executed.

Increasing this delay makes it more likely (but obviously not guaranteed) that the bot's vhost has been applied early enough.

kaneda commented 9 years ago

Hm, I hate the idea of sleep. If you enable SASL then the auth happens before connect finishes, which is advised. @myano what do you think?

solidgoldbomb commented 9 years ago

Agreed about using sleep as an interlock being lame but if it's too short then it might as well be removed entirely.

The only reason I was looking at nickserv identify in the logs was because SASL was failing occasionally. Will open an issue for that later with a log (and maybe a fix).

solidgoldbomb commented 9 years ago

I've run through many tests of disconnect/reconnect while investigating other bugs. With the original sleep of 5s, the first JOIN always happen before the IDENTIFY has completed. With 10s, the IDENTIFY "always" finishes before the first JOIN. I'm reasonably sure this makes the typical case better, but obviously can't guarantee the order when nickserv is slow for some reason.

kaneda commented 9 years ago

Given this occurs at the beginning of startup (e.g., before a user should be able to enter commands) a thread-lock isn't terrible, though at some point I'd love to chain these events more appropriately. @solidgoldbomb can you file an issue that would see us implement a mutex around JOIN on the condition of ident if ident should be enabled by the config?