Skip to content
Snippets Groups Projects
Commit 6a5721fd authored by Manuela Kuhn's avatar Manuela Kuhn
Browse files

Destroy context instantly

parent e4470176
No related branches found
No related tags found
No related merge requests found
...@@ -509,7 +509,7 @@ class dataTransfer(): ...@@ -509,7 +509,7 @@ class dataTransfer():
if not self.externalContext and self.context: if not self.externalContext and self.context:
try: try:
self.log.info("Closing ZMQ context...") self.log.info("Closing ZMQ context...")
self.context.destroy() self.context.destroy(0)
self.context = None self.context = None
self.log.info("Closing ZMQ context...done.") self.log.info("Closing ZMQ context...done.")
except: except:
......
...@@ -9,9 +9,9 @@ localTarget = /space/projects/zeromq-data-transfer/data/target ...@@ -9,9 +9,9 @@ localTarget = /space/projects/zeromq-data-transfer/data/target
#localTarget = /gpfs #localTarget = /gpfs
# Type of event detector to use (options are: inotifyx, watchdog, zmq) # Type of event detector to use (options are: inotifyx, watchdog, zmq)
#eventDetectorType = InotifyxDetector eventDetectorType = InotifyxDetector
#eventDetectorType = WatchdogDetector #eventDetectorType = WatchdogDetector
eventDetectorType = ZmqDetector #eventDetectorType = ZmqDetector
# Event type of files to be monitored (options are: IN_CLOSE_WRITE, IN_MOVED_TO, ...) # Event type of files to be monitored (options are: IN_CLOSE_WRITE, IN_MOVED_TO, ...)
monitoredEventType = IN_CLOSE_WRITE monitoredEventType = IN_CLOSE_WRITE
#monitoredEventType = IN_MOVED_TO #monitoredEventType = IN_MOVED_TO
...@@ -23,14 +23,14 @@ monitoredFormats = [".tif", ".cbf"] ...@@ -23,14 +23,14 @@ monitoredFormats = [".tif", ".cbf"]
timeTillClosed = 2 timeTillClosed = 2
# Module with methods specifying how to get the data (options are "getFromFile", "getFromZmq") # Module with methods specifying how to get the data (options are "getFromFile", "getFromZmq")
#dataFetcherType = getFromFile dataFetcherType = getFromFile
dataFetcherType = getFromZmq #dataFetcherType = getFromZmq
# If "getFromZmq" is specified as dataFetcherType is needs a port to listen to # If "getFromZmq" is specified as dataFetcherType is needs a port to listen to
dataFetcherPort = 50010 dataFetcherPort = 50010
# List of hosts allowed to connect # List of hosts allowed to connect
whitelist = ["localhost", "zitpcx19282", "zitpcx22614", "haspp11eval01", "it-hpc-cxi03"] whitelist = ["localhost", "zitpcx19282", "zitpcx22614", "lsdma-lab04", "haspp11eval01", "it-hpc-cxi03"]
#whitelist = ["localhost", "haspp11eval01", "it-hpc-cxi03"] #whitelist = ["localhost", "haspp11eval01", "it-hpc-cxi03"]
# Number of parallel data streams # Number of parallel data streams
...@@ -38,7 +38,7 @@ whitelist = ["localhost", "zitpcx19282", "zitpcx22614", "haspp11eval01" ...@@ -38,7 +38,7 @@ whitelist = ["localhost", "zitpcx19282", "zitpcx22614", "haspp11eval01"
numberOfStreams = 1 numberOfStreams = 1
# Enable ZMQ pipe into storage system (if set to False: the file is moved into the localTarget) # Enable ZMQ pipe into storage system (if set to False: the file is moved into the localTarget)
useDataStream = True useDataStream = False
# Fixed host to send the data to with highest priority # Fixed host to send the data to with highest priority
fixedStreamHost = zitpcx19282 fixedStreamHost = zitpcx19282
# Fixed Port to send the data to with highest priority # Fixed Port to send the data to with highest priority
......
...@@ -227,7 +227,7 @@ class DataDispatcher(): ...@@ -227,7 +227,7 @@ class DataDispatcher():
self.dataFetcher.clean(self.dataFetcherProp) self.dataFetcher.clean(self.dataFetcherProp)
if not self.extContext and self.context: if not self.extContext and self.context:
self.log.debug("Destroying context") self.log.debug("Destroying context")
self.context.destroy() self.context.destroy(0)
self.context = None self.context = None
......
...@@ -183,6 +183,8 @@ class SignalHandler(): ...@@ -183,6 +183,8 @@ class SignalHandler():
if checkStatus: if checkStatus:
self.reactToSignal(signal, target) self.reactToSignal(signal, target)
continue
if self.requestSocket in socks and socks[self.requestSocket] == zmq.POLLIN: if self.requestSocket in socks and socks[self.requestSocket] == zmq.POLLIN:
self.log.debug("") self.log.debug("")
self.log.debug("!!!! requestSocket !!!!") self.log.debug("!!!! requestSocket !!!!")
...@@ -219,7 +221,7 @@ class SignalHandler(): ...@@ -219,7 +221,7 @@ class SignalHandler():
else: else:
self.log.debug("Version are not compatible") self.log.debug("Version are not compatible")
self.sendResponse("VERSION_CONFLICT") self.sendResponse("VERSION_CONFLICT")
return False, None, None, None return False, None, None
if signal and host: if signal and host:
...@@ -232,7 +234,7 @@ class SignalHandler(): ...@@ -232,7 +234,7 @@ class SignalHandler():
self.log.debug("One of the hosts is not allowed to connect.") self.log.debug("One of the hosts is not allowed to connect.")
self.log.debug("hosts: " + str(host)) self.log.debug("hosts: " + str(host))
self.sendResponse("NO_VALID_HOST") self.sendResponse("NO_VALID_HOST")
return False, None, None, None return False, None, None
return True, signal, target return True, signal, target
...@@ -361,7 +363,7 @@ class SignalHandler(): ...@@ -361,7 +363,7 @@ class SignalHandler():
self.requestSocket.close(0) self.requestSocket.close(0)
self.requestSocket = None self.requestSocket = None
if not self.extContext and self.context: if not self.extContext and self.context:
self.context.destroy() self.context.destroy(0)
self.context = None self.context = None
......
...@@ -184,7 +184,7 @@ class TaskProvider(): ...@@ -184,7 +184,7 @@ class TaskProvider():
self.requestFwSocket.close(0) self.requestFwSocket.close(0)
self.requestFwSocket = None self.requestFwSocket = None
if not self.extContext and self.context: if not self.extContext and self.context:
self.context.destroy() self.context.destroy(0)
self.context = None self.context = None
......
...@@ -96,7 +96,7 @@ class EventDetector(): ...@@ -96,7 +96,7 @@ class EventDetector():
if not self.externalContext and self.context: if not self.externalContext and self.context:
try: try:
self.log.info("Closing ZMQ context...") self.log.info("Closing ZMQ context...")
self.context.destroy() self.context.destroy(0)
self.context = None self.context = None
self.log.info("Closing ZMQ context...done.") self.log.info("Closing ZMQ context...done.")
except: except:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment