Author Topic: IM needs to be periodically reset? OPEN  (Read 4283 times)

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
IM needs to be periodically reset? OPEN
« on: December 20, 2007, 07:17:25 PM »
After running for a few hours, my Darwinbots program suddenly won't connect to the internet.  Resetting the program fixes this, but then it'll happen again a few hours later.  The first hint that something isn't right in the log says something like "error disconnecting".
« Last Edit: December 30, 2007, 06:59:56 PM by EricL »

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #1 on: December 20, 2007, 07:28:56 PM »
I wish I knew what the issue was with this.  I've tried lots of different things.  I'll keep at it I guess.
Many beers....

Offline MacadamiaNuts

  • Bot Destroyer
  • ***
  • Posts: 273
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #2 on: December 20, 2007, 07:33:17 PM »
It happens under Linux/Wine too, so I betcha it isn't a software conflict.
Sometimes you win, and sometimes you lose...

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #3 on: December 20, 2007, 07:49:38 PM »
Is there a way to reallocate the FTP control periodically?  At least so I don't have to reset the program all the time?

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #4 on: December 20, 2007, 07:54:12 PM »
Not that I've found.  The VB Inet control isn't unloadable and calling Inet.Cancel doesn't address it.
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #5 on: December 21, 2007, 02:28:04 AM »
I think this is getting worse the more we run it. Have you thought about that maybe it's the guys who you have bought the server space from that might have some antispam protection that tries to stop this. It was mensioned here before. Maybe you could talk to them or find a better server.
Yesterday when I was running in IM I found that the sim had frozen and generated all sorts of errors in the log. After 6 min with the sim not moving I gave up and quitted. There were only 25 vegs in it. Nothing came in or out.
The internet is corrupt and controlled by criminally minded people.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #6 on: December 21, 2007, 09:08:17 AM »
The FTP server is hosted on the same place as our webspace: GoDaddy.  I called tech support a while ago when Eric was having problems.  They said that the FTP connection should be up 100% of the time.  If it's not, it's a tech problem.  However I don't think these issues are related to the FTP side of things.  I'm thinking it's something wrong with the way the VB control works.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #7 on: December 21, 2007, 11:08:13 AM »
My theory is that there's a session leak, either in the control itself or in the way I handle various failures when two sims try to access the same file for example.  A session or two leaks, and since our FTP server only allows 2 sessions per IP address, the third session hangs and starts timing out.  It shouldn't do this, but perhaps the control doesn't know how to handle this specific return code or similar.  The "hang" effect is FTP session operations timing out.  I have two time out timers going for FTP operations that take too long, one built into the control itself (Inet.StillExecuting) and one I built myself using a separate timer control.   I loop waiting for .StillExecuting to go false, handling events in the loop.  Sometimes the control just never comes back I.e. StillExecuting never goes false.  I time out myself and try to cancel the operation, but if the control or server isn't listening... that is when you see the "Still Exceuting previous operation" message.

I'll try playing a little with error handling.  Once we move to another server which allows more than 2 sessions per IP, things may suddenly get better or not.  I hope to fix this specific issue, but we are going to need to write a server and build ourselves our own protocol at some point if we ever want to scale this up large...
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #8 on: December 21, 2007, 11:43:06 AM »
I still think for a long term solution we should explore some sort of PHP script that feeds data in to a database.  That way you wouldn't even need to use Darwinbots to check to see what the current state of the megasim is.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #9 on: December 21, 2007, 12:17:16 PM »
That would be fine for stats but we still need to move bots between sims, which is the bulk of what we do today via FTP.
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #10 on: December 21, 2007, 12:39:45 PM »
I haven't explored it totally yet, but I'm pretty sure you can hook up a file upload to a PHP page.  The program would call the web page with the specified file and it would get uploaded and stored.  Likewise, the program could call up a similar page to download a bot.

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #11 on: January 12, 2008, 04:11:51 PM »
bump to bring open bug to first page
Many beers....

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
IM needs to be periodically reset? OPEN
« Reply #12 on: January 13, 2008, 09:20:30 AM »
Another possible solution: build a separate C# DLL that handles communicating with the FTP server.  Have Darwinbots call this separate internet handling mechanism.  The DLL could run as a separate thread, solving issues with IM freezing the sim and making the program unresponsive periodically.  C# also generally has better internet communications controls with better debugging.

IM is so removed from the actual program, getting the two to interface would be easy.  All you need is for DB to tell it a file to try and upload, give it the go-ahead to download, and a way for the DLL to send back status reports (server unreachable, etc. etc.)

The downside, obviously, is that now you'd have to support two programs.  But then the IM controls would change so infrequently you could just have it as part of a base installer, and work upgrades like you've been doing.  Renaming the DLL with each new DLL release solves problems of the VB program trying to access an invalid version, if that's ever a problem.