Skip to content
Open
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 @@ -200,10 +200,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't as wait=True blocks forever and doesn't have a timeout.

self.transport.wait_for_connection(30) # pylint: disable=no-member
if self.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