i'm running some code to process features from within bin/omero shell that's exhibiting some strange behavior (it's similarly strange when run as a python script):
- Code: Select all
for iid in list:
filename='iid'+str(iid)+ '_fieldfeatures.h5'
query = 'select f.id from originalfile f where f.name = \''+ filename +'\''
output=subprocess.Popen(['psql','omero2','-c',query],stdout=subprocess.PIPE)
if '0 row' in output.communicate()[0]:
features = pslid.calculateFeatures( session, gateway, iid )
pslid.linkFeatures( session, iid, features )
now=datetime.datetime.now()
print str(iid),now.hour,now.minute,now.second
PrintToFile1(str(iid)+' '+str(now.hour)+' '+str(now.minute)+' '+str(now.secon\
d))
del features
else:
print 'iid '+str(iid)+' already calculated'
del filename, query, output
if len(list)< approx 110, this code runs fine.
however, at some point > 100, the code either stalls or causes an error. the error is not always the same, but at least a couple times it was a heap space error. this latest time, i got the following error a couple times:
- Code: Select all
2011-04-05 04:44:46,870 ERROR [ ome.services.throttling.Task] (l.Server-5) Failed to invoke exception()
this also happens if i run (for example) list A with 50 iids and then list B with 100 iids.
if i don't restart the server before rerunning the script or restarting omero shell, an error, not always the same as the one that crashed it, occurs. i tried putting del statements in the pslid.calculateFeatures and pslid.linkFeatures functions as well but that didn't seem to make a difference.
any suggestions would be appreciated.