Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6600

IRC Bot should wait a bit before joining channels

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • ircbot-plugin
    • None
    • Hudson 1.359 on Linux inside Jetty, IRC Plugin v2.4

      We use an invite exclusion for the IRC bot based on a cloak that gets applied after the bot identifies to NickServ. The bot seems to try to identify, then join the channels before the network's services can apply the cloak, keeping the bot from joining the channel.

      It would be nice if the bot could wait for notification from services (I can't think of an IRC network agnostic way to do this), or at least sleep for a period of time after identifying to services.

          [JENKINS-6600] IRC Bot should wait a bit before joining channels

          Mark Walling added a comment -

          I re-thought my approach to this. Now, instead of trying to handle how different networks handle things, if the bot can't join the channel on the first try, tough luck.

          Instead, the bot can be invited to the channel, and if it is in the IRCConnection.groupChats List, it will join that channel.

          The bot will still try to send messages to channels it is not in, but that doesn't seem to hurt anything.

          http://codereview.appspot.com/1911042/show

          Mark Walling added a comment - I re-thought my approach to this. Now, instead of trying to handle how different networks handle things, if the bot can't join the channel on the first try, tough luck. Instead, the bot can be invited to the channel, and if it is in the IRCConnection.groupChats List, it will join that channel. The bot will still try to send messages to channels it is not in, but that doesn't seem to hurt anything. http://codereview.appspot.com/1911042/show

          rshelley added a comment -

          I have a similar issue where the IRC bot will try to connect to the server and (apparently) timeout:

          ----------
          Sep 2, 2010 8:50:23 AM hudson.plugins.ircbot.v2.IRCConnection connect
          INFO: connected to IRC
          Sep 2, 2010 8:50:23 AM hudson.plugins.ircbot.v2.IRCConnection getGroupChat
          INFO: Trying to join channel #welcome
          ----------
          (never reaches the "Joined channel..." log line)

          It seems to be happening at this line (it's nested, so I don't know which constructor is causing it):

          ----------
          // TODO: how to check that join was successful (channelJoined is called later -
          // how long should we possibly wait until we declare that join was unsuccessful?)
          this.bots.add(new Bot(new IRCChannel(channel.getName(), this.pircConnection),
          this.descriptor.getNick(), this.descriptor.getHost(),
          this.descriptor.getCommandPrefix(), this.authentication));
          ----------

          When I query my OperServ, however, I don't see my bot connected, so I can't invite it as suggested previously. I've tried inviting it anyway, and it won't let me (because it's not connected). Checking my IRC connection logs, I see connections from my users, but not from the Hudson IRC bot. I suppose it's possible that some exception is being thrown during connection but being handled silently.

          I've tried connecting with my Chan/NickServ bot offline, to see if maybe it was booting it, and that didn't help. I've tried turning off my NickServ Identify password to just let it join as an unregistered user (my internal IRC doesn't require a registered account).

          I can connect to the server as the Hudson IRC bot user with an IRC client, so I know the user and NickServ password are correct. One thing to note is that if I'm connected via a client to the Hudson IRC bot account, and the Hudson plugin tries to connect, it does report that the username is already in use, so I know that a basic connection is being made, but not much more. I'm not really sure what else to check.

          rshelley added a comment - I have a similar issue where the IRC bot will try to connect to the server and (apparently) timeout: ---------- Sep 2, 2010 8:50:23 AM hudson.plugins.ircbot.v2.IRCConnection connect INFO: connected to IRC Sep 2, 2010 8:50:23 AM hudson.plugins.ircbot.v2.IRCConnection getGroupChat INFO: Trying to join channel #welcome ---------- (never reaches the "Joined channel..." log line) It seems to be happening at this line (it's nested, so I don't know which constructor is causing it): ---------- // TODO: how to check that join was successful (channelJoined is called later - // how long should we possibly wait until we declare that join was unsuccessful?) this.bots.add(new Bot(new IRCChannel(channel.getName(), this.pircConnection), this.descriptor.getNick(), this.descriptor.getHost(), this.descriptor.getCommandPrefix(), this.authentication)); ---------- When I query my OperServ, however, I don't see my bot connected, so I can't invite it as suggested previously. I've tried inviting it anyway, and it won't let me (because it's not connected). Checking my IRC connection logs, I see connections from my users, but not from the Hudson IRC bot. I suppose it's possible that some exception is being thrown during connection but being handled silently. I've tried connecting with my Chan/NickServ bot offline, to see if maybe it was booting it, and that didn't help. I've tried turning off my NickServ Identify password to just let it join as an unregistered user (my internal IRC doesn't require a registered account). I can connect to the server as the Hudson IRC bot user with an IRC client, so I know the user and NickServ password are correct. One thing to note is that if I'm connected via a client to the Hudson IRC bot account, and the Hudson plugin tries to connect, it does report that the username is already in use, so I know that a basic connection is being made, but not much more. I'm not really sure what else to check.

          kutzi added a comment -

          It'd be great if you could test these attached development versions, if they work like desired for you.

          kutzi added a comment - It'd be great if you could test these attached development versions, if they work like desired for you.

          Code changed in hudson
          User: : kutzi
          Path:
          trunk/hudson/plugins/ircbot/src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java
          trunk/hudson/plugins/ircbot/src/main/java/hudson/plugins/ircbot/v2/PircConnection.java
          http://jenkins-ci.org/commit/36175
          Log:
          JENKINS-6600 ircbot may be invited to a channel

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kutzi Path: trunk/hudson/plugins/ircbot/src/main/java/hudson/plugins/ircbot/v2/IRCConnection.java trunk/hudson/plugins/ircbot/src/main/java/hudson/plugins/ircbot/v2/PircConnection.java http://jenkins-ci.org/commit/36175 Log: JENKINS-6600 ircbot may be invited to a channel

          rshelley added a comment -

          Having the same issue still, but I'm on 1.372 and will try upgrading to 1.382 (to help resolve other issues). Will follow-up after the upgrade.

          rshelley added a comment - Having the same issue still, but I'm on 1.372 and will try upgrading to 1.382 (to help resolve other issues). Will follow-up after the upgrade.

          rshelley added a comment -

          Upgraded to 1.382 and same issue persists. I wonder if it could be a issue that Hudson and my IRC server run on the same box?

          rshelley added a comment - Upgraded to 1.382 and same issue persists. I wonder if it could be a issue that Hudson and my IRC server run on the same box?

          kutzi added a comment -

          rshelley: a stack dump of your Hudson server when it's currently trying to connect to your IRC server could help.

          What's the type of your IRC server?

          kutzi added a comment - rshelley: a stack dump of your Hudson server when it's currently trying to connect to your IRC server could help. What's the type of your IRC server?

          rshelley added a comment -

          Tomcat stdout
          http://hudson.pastebin.com/hfYTJSii

          Thread Dump
          http://hudson.pastebin.com/hVbyhpDY

          IRC Server: Unreal 3.2

          rshelley added a comment - Tomcat stdout http://hudson.pastebin.com/hfYTJSii Thread Dump http://hudson.pastebin.com/hVbyhpDY IRC Server: Unreal 3.2

          kutzi added a comment -

          Attached an ircbot.hpi which logs all server responses.
          Maybe you want to try it.

          kutzi added a comment - Attached an ircbot.hpi which logs all server responses. Maybe you want to try it.

          kutzi added a comment -

          Fixed in IRC plugin 2.7

          rshelley: I believe what you see, is a different issue. If it persists please open a new JIRA issue for it.

          kutzi added a comment - Fixed in IRC plugin 2.7 rshelley: I believe what you see, is a different issue. If it persists please open a new JIRA issue for it.

            kutzi kutzi
            mwalling Mark Walling
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: