Skip to content

Commit e17f3f8

Browse files
authored
Merge pull request #7061 from sfayer/close_sel
[v8r0] Close DISET selector when we no longer need it
2 parents 0021efc + c92e68e commit e17f3f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/DIRAC/Core/DISET/private/MessageBroker.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def __listenAutoReceiveConnections(self):
134134
continue
135135
sel.register(mt["transport"].getSocket(), selectors.EVENT_READ, trid)
136136
if not sel.get_map():
137+
sel.close()
137138
self.__listeningForMessages = False
138139
return
139140
finally:
@@ -148,6 +149,8 @@ def __listenAutoReceiveConnections(self):
148149
except Exception as e:
149150
gLogger.exception("Exception while selecting persistent connections", lException=e)
150151
continue
152+
finally:
153+
sel.close()
151154

152155
for key, event in events:
153156
if event & selectors.EVENT_READ:

0 commit comments

Comments
 (0)