bshyong / ga-bitbot

Automatically exported from code.google.com/p/ga-bitbot
GNU General Public License v3.0
1 stars 0 forks source link

gal.py crashes on first startup #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello!

    I have checked out todays version from the git tree and tried running it the old way [manualy started each component]. It seemed to work correctly. Afterwards, I tried running the new gal.py script and it failed to start. The output is pasted at the end of this description. Please, ignore/close this issue if you already know about this =]

Feel free to ask for any testing I may help you with.

Kind regards!

----
user@machine:~/tmp/ga-bitbot$ pypy gal.py
ga-bitbot system launcher v0.01a
Synching the local datafeed...

Bitcoin Data Download (CSV) Processor v0.01a

    Converts the data into a weighted price 1min data feed format

To automaticaly download and process the mtgox usd historic data run with the 
following option:
python process -d

Without the -d switch the output will only be written to the datafeed_reboot 
folder

Checking potential for incremental update...
Downloading mtgox historic data...
Download complete.
Processing input...
Writing output file...
Updating the datafeed directory directly...no need to manualy move the output 
file
Writing incremental update...
Done.
Starting the live datafeed capture script...
Launching the xmlrpc server...
Connected to 127.0.0.1 : 9854
Load archived gene database? (y/n)
y
Loading the gene database...
NOK
Launching GA Clients...
Monitored Process Launched (PID: 360a27b7 CMD: pypy gts.py 1 n )
Monitored Process Launched (PID: c1cc9163 CMD: pypy gts.py 2 n )
Monitored Process Launched (PID: 49d65d51 CMD: pypy gts.py 3 n )
Monitored Process Launched (PID: 0cae0ab7 CMD: pypy gts.py 4 n )
Traceback (most recent call last):
  File "app_main.py", line 53, in run_toplevel
  File "gal.py", line 106, in <module>
    monitor.update({npl[0]:{'cmd':cmd_line,'process':p}})   #store the pid/cmd_line/process
IndexError: list index out of range
user@machine:~/tmp$ pypy --version
Python 2.7.1 (?, Oct 08 2011, 14:11:45)
[PyPy 1.6.0 with GCC 4.5.2]

Original issue reported on code.google.com by purge...@gmail.com on 28 Dec 2011 at 3:45

GoogleCodeExporter commented 9 years ago
I think I know what's happening. It may be that the delay time to wait for the 
process to report back may be too small.

Can you modify the script gal.py on line 102 to increase the sleep time to 5 
seconds to help me verify the issue?

#start the monitored processes
for cmd_line in monitored_launch:
        p = Popen(shlex.split(cmd_line),stdin=fnull, stdout=fnull, stderr=fnull)
        sleep(1)     ##*<-------- Increase this value*
        cpl = json.loads(server.pid_list())     #get the current pid list
        npl = list(set(epl) ^ set(cpl))         #find the new pid(s)
        epl = cpl                               #update the existing pid list
        monitor.update({npl[0]:{'cmd':cmd_line,'process':p}})   #store the pid/cmd_line/process
        print "Monitored Process Launched (PID:",npl[0],"CMD:",cmd_line,")"

Original comment by brian.mo...@gmail.com on 2 Jan 2012 at 7:13

GoogleCodeExporter commented 9 years ago
I updated the code on the repo to include a default monitored process launch 
timeout of 20 seconds. If this fixes your issue let me know and I'll close the 
issue as verified.

Original comment by brian.mo...@gmail.com on 2 Jan 2012 at 7:38

GoogleCodeExporter commented 9 years ago
I apologize for the late answer. Indeed, it does work now :) 

Original comment by purge...@gmail.com on 9 Jan 2012 at 8:59