Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
285882c1
Commit
285882c1
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-827
: make sure that the BusListenerJanitor always deletes the buslistener's queue
parent
703a2d9a
No related branches found
No related tags found
2 merge requests
!74
Lofar release 4 0
,
!71
Resolve SW-827
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/Messaging/python/messaging/messagebus.py
+18
-6
18 additions, 6 deletions
LCS/Messaging/python/messaging/messagebus.py
with
18 additions
and
6 deletions
LCS/Messaging/python/messaging/messagebus.py
+
18
−
6
View file @
285882c1
...
@@ -1621,19 +1621,31 @@ class BusListenerJanitor:
...
@@ -1621,19 +1621,31 @@ class BusListenerJanitor:
def
__enter__
(
self
)
->
BusListener
:
def
__enter__
(
self
)
->
BusListener
:
"""
enter the context, and make the bus_listener start listening.
"""
enter the context, and make the bus_listener start listening.
:return a reference to the buslistener, not to the janitor!
"""
:return a reference to the buslistener, not to the janitor!
"""
self
.
_bus_listener
.
start_listening
()
try
:
return
self
.
_bus_listener
self
.
open
()
return
self
.
_bus_listener
except
Exception
as
e
:
logger
.
exception
(
e
)
self
.
close
()
raise
def
__exit__
(
self
,
exc_type
,
exc_val
,
exc_tb
):
def
__exit__
(
self
,
exc_type
,
exc_val
,
exc_tb
):
"""
leave the context, make the bus_listener stop listening,
"""
leave the context, make the bus_listener stop listening,
and clean up the auto-generated queue
"""
and clean up the auto-generated queue
"""
self
.
close
()
def
open
(
self
):
"""
make the bus_listener start listening.
"""
self
.
_bus_listener
.
start_listening
()
def
close
(
self
):
"""
make the bus_listener stop listening, and delete listener queue
"""
try
:
try
:
bus_listener_address
=
self
.
_bus_listener
.
address
self
.
_bus_listener
.
stop_listening
()
self
.
_bus_listener
.
stop_listening
()
except
Exception
as
e
:
logger
.
error
(
e
)
finally
:
finally
:
logger
.
info
(
"
BusListenerJanitor deleting auto-generated queue: %s
"
,
self
.
_
bus_listener
.
address
)
logger
.
info
(
"
BusListenerJanitor deleting auto-generated queue: %s
"
,
bus_listener
_
address
)
delete_queue
(
self
.
_
bus_listener
.
address
)
delete_queue
(
bus_listener
_
address
)
# do not expose create/delete_queue/exchange etc methods in all, it's not part of the public API
# do not expose create/delete_queue/exchange etc methods in all, it's not part of the public API
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment