Skip to content
GitLab
Explore
Sign in
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
fab43c61
Commit
fab43c61
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-699
: logging
parent
80696137
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LCS/Messaging/python/messaging/messagebus.py
+6
-0
6 additions, 0 deletions
LCS/Messaging/python/messaging/messagebus.py
LCS/Messaging/python/messaging/rpc.py
+10
-10
10 additions, 10 deletions
LCS/Messaging/python/messaging/rpc.py
with
16 additions
and
10 deletions
LCS/Messaging/python/messaging/messagebus.py
+
6
−
0
View file @
fab43c61
...
@@ -1241,6 +1241,12 @@ class BusListener:
...
@@ -1241,6 +1241,12 @@ class BusListener:
"""
"""
self
.
stop_listening
()
self
.
stop_listening
()
def
__str__
(
self
):
return
"
%s using handler
'
%s
'
listening on queue
'
%s
'
at broker
'
%s
'"
%
(
self
.
__class__
.
__name__
,
self
.
_handler_type
.
__name__
,
self
.
address
,
self
.
broker
)
def
_create_handler
(
self
):
def
_create_handler
(
self
):
return
self
.
_handler_type
(
**
self
.
_handler_kwargs
)
return
self
.
_handler_type
(
**
self
.
_handler_kwargs
)
...
...
This diff is collapsed.
Click to expand it.
LCS/Messaging/python/messaging/rpc.py
+
10
−
10
View file @
fab43c61
...
@@ -354,9 +354,9 @@ class RPCClient():
...
@@ -354,9 +354,9 @@ class RPCClient():
ttl
=
max
(
0
,
self
.
_timeout
-
elapsed
),
ttl
=
max
(
0
,
self
.
_timeout
-
elapsed
),
priority
=
4
).
with_args_kwargs
(
*
args
,
**
kwargs
)
priority
=
4
).
with_args_kwargs
(
*
args
,
**
kwargs
)
logger
.
debug
(
"
executing rpc call to exchange=%s service.method=%s args=%s kwargs=%s waiting for answer on %s
"
,
logger
.
debug
(
"
executing rpc call to service.method=%s via exchange=%s args=%s kwargs=%s waiting for answer on %s
"
,
exchange
,
service_method
,
service_method
,
exchange
,
args
,
kwargs
,
args
,
kwargs
,
tmp_reply_queue
.
address
)
tmp_reply_queue
.
address
)
...
@@ -365,25 +365,25 @@ class RPCClient():
...
@@ -365,25 +365,25 @@ class RPCClient():
elapsed
=
(
datetime
.
utcnow
()
-
start_time
).
total_seconds
()
elapsed
=
(
datetime
.
utcnow
()
-
start_time
).
total_seconds
()
wait_time
=
max
(
0
,
self
.
_timeout
-
elapsed
)
wait_time
=
max
(
0
,
self
.
_timeout
-
elapsed
)
logger
.
debug
(
"
executed rpc call to exchange=%s service.method=%s waiting %.1fsec for answer on %s
"
,
logger
.
debug
(
"
executed rpc call to service.method=%s via exchange=%s waiting %.1fsec for answer on %s
"
,
exchange
,
service_method
,
service_method
,
exchange
,
wait_time
,
wait_time
,
tmp_reply_queue
.
address
)
tmp_reply_queue
.
address
)
answer
=
reply_receiver
.
receive
(
wait_time
)
answer
=
reply_receiver
.
receive
(
wait_time
)
if
answer
is
None
:
if
answer
is
None
:
raise
TimeoutError
(
"
rpc call to
exchange=%s
service.method=%s
timed out
"
%
(
raise
TimeoutError
(
"
rpc call to service.method=%s
via exchange=%s timed out after %.1fsec
"
%
(
exchange
,
service_method
))
service_method
,
exchange
,
self
.
_timeout
))
if
not
isinstance
(
answer
,
ReplyMessage
):
if
not
isinstance
(
answer
,
ReplyMessage
):
raise
ValueError
(
"
rpc call to
exchange=%s
service.method=%s received an unexpected non-ReplyMessage of type %s
"
%
(
raise
ValueError
(
"
rpc call to service.method=%s
via exchange=%s
received an unexpected non-ReplyMessage of type %s
"
%
(
exchange
,
service_method
,
answer
.
__class__
.
__name__
))
service_method
,
exchange
,
answer
.
__class__
.
__name__
))
logger
.
debug
(
"
executed rpc call to exchange=%s service.method=%s received valid answer on %s
"
,
logger
.
debug
(
"
executed rpc call to service.method=%s via exchange=%s received valid answer on %s
"
,
service_method
,
exchange
,
exchange
,
request_msg
.
subject
,
tmp_reply_queue
.
address
)
tmp_reply_queue
.
address
)
if
answer
.
handled_successfully
:
if
answer
.
handled_successfully
:
...
...
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