Commit baab4950 authored by Valentin Reis's avatar Valentin Reis
Browse files

Merge branch 'minimize-zmq-threads' into 'master'

[fix] Resolve open files leaks

See merge request !57
parents d3ae2478 7af15806
Pipeline #5235 failed with stages
in 14 minutes and 32 seconds
include: 'https://xgitlab.cels.anl.gov/argo/argotest/raw/master/gitlab/binary_rename.yml' include: 'https://xgitlab.cels.anl.gov/argo/argotest/raw/master/gitlab/basic.yml'
stages: stages:
- style - style
......
...@@ -3,5 +3,5 @@ let argotest = ...@@ -3,5 +3,5 @@ let argotest =
"https://xgitlab.cels.anl.gov/argo/argotest/-/archive/master/argotest-master.tar.gz"; "https://xgitlab.cels.anl.gov/argo/argotest/-/archive/master/argotest-master.tar.gz";
in import "${argotest}/test.nix" { in import "${argotest}/test.nix" {
nrm-override = ./.; nrm-override = ./.;
testName = "split"; testName = "base";
} }
...@@ -248,7 +248,7 @@ class DummyRuntime(ContainerRuntime): ...@@ -248,7 +248,7 @@ class DummyRuntime(ContainerRuntime):
def execute(self, container_uuid, args, environ): def execute(self, container_uuid, args, environ):
import tornado.process as process import tornado.process as process
return process.Subprocess(args, stdin=process.Subprocess.STREAM, return process.Subprocess(args,
stdout=process.Subprocess.STREAM, stdout=process.Subprocess.STREAM,
stderr=process.Subprocess.STREAM, stderr=process.Subprocess.STREAM,
env=environ) env=environ)
......
...@@ -162,7 +162,7 @@ class UpstreamRPCClient(object): ...@@ -162,7 +162,7 @@ class UpstreamRPCClient(object):
def __init__(self, address): def __init__(self, address):
self.address = address self.address = address
self.uuid = str(uuid.uuid4()) self.uuid = str(uuid.uuid4())
self.zmq_context = zmq.Context() self.zmq_context = zmq.Context.instance()
self.socket = self.zmq_context.socket(zmq.DEALER) self.socket = self.zmq_context.socket(zmq.DEALER)
self.socket.setsockopt(zmq.IDENTITY, self.uuid) self.socket.setsockopt(zmq.IDENTITY, self.uuid)
self.socket.connect(address) self.socket.connect(address)
...@@ -195,7 +195,7 @@ class UpstreamRPCServer(object): ...@@ -195,7 +195,7 @@ class UpstreamRPCServer(object):
def __init__(self, address): def __init__(self, address):
self.address = address self.address = address
self.zmq_context = zmq.Context() self.zmq_context = zmq.Context.instance()
self.socket = self.zmq_context.socket(zmq.ROUTER) self.socket = self.zmq_context.socket(zmq.ROUTER)
self.socket.bind(address) self.socket.bind(address)
...@@ -234,7 +234,7 @@ class UpstreamPubServer(object): ...@@ -234,7 +234,7 @@ class UpstreamPubServer(object):
def __init__(self, address): def __init__(self, address):
self.address = address self.address = address
self.zmq_context = zmq.Context() self.zmq_context = zmq.Context.instance()
self.socket = self.zmq_context.socket(zmq.PUB) self.socket = self.zmq_context.socket(zmq.PUB)
self.socket.setsockopt(zmq.LINGER, 0) self.socket.setsockopt(zmq.LINGER, 0)
self.socket.bind(address) self.socket.bind(address)
...@@ -251,7 +251,7 @@ class UpstreamPubClient(object): ...@@ -251,7 +251,7 @@ class UpstreamPubClient(object):
def __init__(self, address): def __init__(self, address):
self.address = address self.address = address
self.zmq_context = zmq.Context() self.zmq_context = zmq.Context.instance()
self.socket = self.zmq_context.socket(zmq.SUB) self.socket = self.zmq_context.socket(zmq.SUB)
self.socket.setsockopt(zmq.SUBSCRIBE, '') self.socket.setsockopt(zmq.SUBSCRIBE, '')
self.socket.connect(address) self.socket.connect(address)
......
...@@ -118,7 +118,7 @@ class NodeOSClient(object): ...@@ -118,7 +118,7 @@ class NodeOSClient(object):
for envname, envval in environ.items()] for envname, envval in environ.items()]
cmd += " env:'"+" ".join(env)+"'" cmd += " env:'"+" ".join(env)+"'"
args.append(cmd) args.append(cmd)
return process.Subprocess(args, stdin=process.Subprocess.STREAM, return process.Subprocess(args,
stdout=process.Subprocess.STREAM, stdout=process.Subprocess.STREAM,
stderr=process.Subprocess.STREAM) stderr=process.Subprocess.STREAM)
......
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