Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/DIRAC/Resources/MessageQueue/StompMQConnector.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,14 @@ def connect(self, parameters=None):

for _ in range(10):
try:
# We need to explicitely call disconnect to avoid leaving
# threads behind
# We need to explicitly call disconnect to avoid leaving threads behind
self.connection.disconnect()
self.connection.connect(username=user, passcode=password, wait=True)

# Connect to the broker with a timeout of 30 seconds
self.connection.connect(username=user, passcode=password, wait=False)
self.connection.transport.wait_for_connection(30) # pylint: disable=no-member
if self.connection.transport.connection_error: # pylint: disable=no-member
raise stomp.exception.ConnectFailedException()

if self.connection.is_connected():
# Go to the socket of the Stomp to find the remote host
Expand Down
Loading