Skip to content

Commit e703b09

Browse files
committed
Do not leak FairMQ socket files
* do not use default /tmp dir for socket files, as they may leak and pose a problem in the long run * offer configurability of fairmq-ipc-prefix * the pipeline runner set this to a new local .tmp folder
1 parent 2273127 commit e703b09

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

MC/bin/o2_dpg_workflow_runner.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,17 @@ def produce_script(self, filename):
938938
def execute(self):
939939
psutil.cpu_percent(interval=None)
940940
os.environ['JOBUTILS_SKIPDONE'] = "ON"
941+
942+
# we make our own "tmp" folder
943+
# where we can put stuff such as tmp socket files etc (for instance DPL FAIR-MQ sockets)
944+
# (In case of running within docker/singularity, this may not be so important)
945+
if not os.path.isdir("./.tmp"):
946+
os.mkdir("./.tmp")
947+
if os.environ.get('FAIRMQ_IPC_PREFIX')==None:
948+
socketpath = os.getcwd() + "/.tmp"
949+
actionlogger.info("Setting FAIRMQ socket path to " + socketpath)
950+
os.environ['FAIRMQ_IPC_PREFIX'] = socketpath
951+
941952
# some maintenance / init work
942953
if args.list_tasks:
943954
print ('List of tasks in this workflow:')

MC/bin/o2dpg_sim_workflow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ def createTask(name='', needs=[], tf=-1, cwd='./', lab=[], cpu=1, relative_cpu=N
109109
return { 'name': name, 'cmd':'', 'needs': needs, 'resources': { 'cpu': cpu , 'mem': mem }, 'timeframe' : tf, 'labels' : lab, 'cwd' : cwd }
110110

111111
def getDPL_global_options(bigshm=False,nosmallrate=False):
112+
common="-b --run --fairmq-ipc-prefix ${FAIRMQ_IPC_PREFIX:-./} --driver-client-backend ws:// " + ('--rate 1000','')[nosmallrate]
112113
if args.noIPC!=None:
113-
return "-b --run --no-IPC " + ('--rate 1000','')[nosmallrate]
114+
return common + " --no-IPC "
114115
if bigshm:
115-
return "-b --run --shm-segment-size ${SHMSIZE:-50000000000} --driver-client-backend ws://" + (' --rate 1000','')[nosmallrate]
116+
return common + " --shm-segment-size ${SHMSIZE:-50000000000} "
116117
else:
117-
return "-b --run " + ' --driver-client-backend ws://' + (' --rate 1000','')[nosmallrate]
118+
return common
118119

119120
doembedding=True if args.embedding=='True' or args.embedding==True else False
120121
usebkgcache=args.use_bkg_from!=None

0 commit comments

Comments
 (0)