|
|||||||
![]() |
Forum Index > Jibble.org > PircBot | ||
PircBot times out |
|||
| | | Printable Version |
|
Anonymous: LoidThanead | ||||||||
|
Hi all, I've been using PircBot for a while now, and I can only conclude that it's a great framework. It's fairly intuitive and easy to use, plus it works as it should. Mostly. The one problem I'm having is that my bot keeps timing out after approximately five minutes. I haven't overriden either the onPing() or the onServerPing() methods, so I have no idea what the problem could be. Any help would be greatly appreciated. Sincerely, Loid |
|
||||||||
|
|||||||||
|
DeadEd | ||||||||
|
Hi Are you doing anything heavy, or blocking in your PircBot extended class? Anything that takes a long time could cause your bot to fail to respond to the server. One thing you could try is running another PircBot, one of the demos or even the tutorial, and see if it stays running or not (this will give an indication if the problem is in your code or somewhere else). |
![]() Moderator Status: offline
Registered: 06/01/04 |
||||||||
|
|||||||||
|
Anonymous: LoidThanead | ||||||||
|
Thanks for the suggestion, I hadn't tried that yet. Now that I have however, I can tell that the problem does not seem to be either my code or the network. I've tried the ColoursAndFormattingBot on two different networks (dynastynet.net and sorcery.net); on both it times out after about five to ten minutes. Might it be relevant that in both cases there was absolutely no activity in the test channel? Also, my bot does not do anything overly heavy, nor does it block the process, to the best of my knowledge. The interesting part is that the server seems to ping the bot several times and receives a proper reply, but then apparently stops pinging and convinces itself the bot timed out. The relevant part of the log output (as far as I can see): 1257277764727 PING :acadia.ny.us.dynastynet.net 1257277764727 >>>PONG :acadia.ny.us.dynastynet.net 1257277854816 PING :acadia.ny.us.dynastynet.net 1257277854816 >>>PONG :acadia.ny.us.dynastynet.net 1257277944812 PING :acadia.ny.us.dynastynet.net 1257277944812 >>>PONG :acadia.ny.us.dynastynet.net 1257278245313 >>>PING 1257278245 1257278245795 *** Disconnected. |
|
||||||||
|
|||||||||
|
Soulwound | ||||||||
|
Hi, sorry to necromancer this thread, but I'm having basically the same problem. I recently started working on pircbot, and have run the test bot, in addition to the bot I am working on, on irc.rizon.org. Sometimes, the bot will reply to a few pings and stop replying, much as the problem Thanead was having, and sometimes it won't even respond to the first ping.
I set up an onDisconnect() function to automatically try reconnecting to the server, which ruled out the application locking up as the culprit, but it seems after it's been booted once, it doesn't respond to pings after it connects again.
Update: The strangest thing happened. On the IRC end, I saw: PHP Formatted Code <Soulwound> salithus[bnc]: http://rackmounted.com/dedicated-servers/SingleCore.shtml * SoulBot has quit (Ping timeout: 240 seconds)
But in the console (verbose is set to true), the following is visible: PHP Formatted Code 1276403177126 >>>PING 1276403177 1276403177201 *** Disconnected.
The URL I had posted didn't show up on the console, but the ping and subsequent disconnect. Very odd, if it had locked up I assume the ping and disconnect wouldn't have shown up on my screen. I'm going to see if uninstalling java and reinstalling it might help fix the problem, though. |
![]() Newbie Status: offline
Registered: 06/12/10 |
||||||||
|
|||||||||
|
DeadEd | ||||||||
|
Hi No, this is a good thread to have open, don't worry about that - this is a general problem it seems, or at least there are enough people having the same problem. I guess any ideas or suggestions from anyone as to what could be causing this are welcome at this point.
I would guess that your URL didn't show up in the bot console because it has already timed out by that point - this happens with many clients before the real disconnect comes. But then, with the bot, the ping came from the server and you got disconnected immediately - so it at least received that from the server. As you say, very odd. I don't think your Java installation would have any impact on this problem. Of course, it doesn't hurt to try and at least cross it off as a possible cause. Let us know what you try and discard and perhaps if we get enough info and ideas, someone might get the light bulb appearing over their head and we'll get a handle on the problem
|
![]() Moderator Status: offline
Registered: 06/01/04 |
||||||||
|
|||||||||
|
Soulwound | ||||||||
|
I think I am making some progress on nailing down the problem.
I tried reinstalling java, which didn't help but I wanted to rule it out. I also tried logging the bot onto freenode, in case rizon was the problem, which also did not help.
I got an idea for my next line of attack when I ran the chat bot demo on rizon, but in a channel that usually has some activity. The bot joined, and stayed in the channel for about 14 minutes. Up until the point it disconnected, there were messages in the channel at least once every two minutes, if not more frequently. During a period of silence, the bot disconnected due to ping four minutes after the last message. I double checked the brain.ser file, and the modified time matched up to the last message before it had disconnected.
I set up my bot to reply to private messages, but only to a user who had sent it a password first. I had it sit in a channel with no activity, and sent it messages once a minute. It replied to each of those messages. I then tried sending messages once every two minutes, and those were all replied to as well. Once I switched to 3 minutes intervals, the console no longer showed the incoming message, and the bot did not reply. A minute later, it would ping out. Watching the console, the ping and disconnect does show up, but not for a minute or two after the IRC server drops the bot for failure to reply to the ping.
It seems odd to me that the bot will appear to hang, but then detect it had been disconnected and perform the onReconnect() functions normally. |
![]() Newbie Status: offline
Registered: 06/12/10 |
||||||||
|
|||||||||
|
DeadEd | ||||||||
|
Not a proper solution, but perhaps something that may keep the bot connected ... What if you have your bot schedule a TimerTask to send a certain message to itself every XX seconds. In the onPrivateMessage() just ignore the message if it comes from itself and has certain content.
|
![]() Moderator Status: offline
Registered: 06/01/04 |
||||||||
|
|||||||||
|
Soulwound | ||||||||
|
Well, for the time being it looks like that wasn't the real problem. I have the same bot running on a virtual dedicated host a friend is renting, and it hasn't pinged out at all.
I guess my 2.8 GHz dual core computer with 8GB of RAM isn't up to the task of running a java bot? |
![]() Newbie Status: offline
Registered: 06/12/10 |
||||||||
|
|||||||||
|
DeadEd | ||||||||
|
LOL, yes IRCing with Java is the next killer app to require more power than a desktop gaming machine If you ever figure out what was causing this behaviour on your machine, then please do resurrect this thread.
|
![]() Moderator Status: offline
Registered: 06/01/04 |
||||||||
|
|||||||||
|
|
| All times are CDT. The time is now 10:06 AM. |
|
|