Commit 70332624 authored by Michael Salim's avatar Michael Salim
Browse files

Merge remote-tracking branch 'origin/develop'

parents c3e0845e badd48f6
import os,sys,time,multiprocessing,Queue,logging
import os,sys,time,multiprocessing,queue,logging
logger = logging.getLogger(__name__)
from django.core.management.base import BaseCommand, CommandError
......@@ -30,7 +30,7 @@ class Command(BaseCommand):
p = UserJobReceiver.UserJobReceiver(process_queue=argo_service_queue)
p.start()
subprocesses['UserJobReceiver'] = p
except Exception,e:
except Exception as e:
logger.exception(' Received Exception while trying to start job receiver: ' + str(e))
raise
logger.debug(' Launching balsam job status receiver ')
......@@ -38,7 +38,7 @@ class Command(BaseCommand):
p = JobStatusReceiver.JobStatusReceiver(process_queue=argo_service_queue)
p.start()
subprocesses['JobStatusReceiver'] = p
except Exception,e:
except Exception as e:
logger.exception(' Received exception while trying to start balsam job status receiver: ' + str(e))
raise
......@@ -90,7 +90,7 @@ class Command(BaseCommand):
+ str(settings.ARGO_MAX_CONCURRENT_TRANSITIONS))
# loop over running process and check status
for name,proc in subprocesses.iteritems():
for name,proc in subprocesses.items():
if not proc.is_alive():
logger.info(' subprocess ' + name + ' has stopped with returncode ' + str(proc.exitcode) )
......@@ -119,7 +119,7 @@ class Command(BaseCommand):
job.save(update_fields=['state'])
else:
logger.error('Unrecognized QueueMessage code: ' + str(qmsg.code))
except Queue.Empty:
except queue.Empty:
logger.debug(' no objects on queue ')
......@@ -127,7 +127,7 @@ class Command(BaseCommand):
if settings.ARGO_DELETE_OLD_WORK:
workDirCleaner.clean()
for key,item in receivers.iteritems():
for key,item in receivers.items():
item.terminate()
item.join()
......
......@@ -9,11 +9,11 @@ from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.core.validators import validate_comma_separated_integer_list
from argo import QueueMessage,ArgoJobStatus
from common import log_uncaught_exceptions,MessageInterface
from common import Serializer,transfer,Mail,db_tools
from balsam.models import BalsamJob
from balsam.models import STATES_BY_NAME as BALSAM_STATES_BY_NAME
from balsam.argo import QueueMessage,ArgoJobStatus
from balsam.common import log_uncaught_exceptions,MessageInterface
from balsam.common import Serializer,transfer,Mail,db_tools
from balsam.service.models import BalsamJob
from balsam.service.models import STATES_BY_NAME as BALSAM_STATES_BY_NAME
# assign this function to the system exception hook
sys.excepthook = log_uncaught_exceptions.log_uncaught_exceptions
......@@ -185,7 +185,7 @@ def send_status_message(job,message=None):
# ------------ Job States ----------------------------
from common.JobState import JobState
from balsam.common.JobState import JobState
# Job States
CREATE_FAILED = JobState('CREATE_FAILED')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment