Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coolamqp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
public
coolamqp
Commits
0f80c4f1
Commit
0f80c4f1
authored
5 years ago
by
Piotr Maślanka
Browse files
Options
Downloads
Patches
Plain Diff
fix utils
parent
813b804c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
coolamqp/attaches/declarer.py
+17
-6
17 additions, 6 deletions
coolamqp/attaches/declarer.py
coolamqp/attaches/publisher.py
+2
-2
2 additions, 2 deletions
coolamqp/attaches/publisher.py
coolamqp/attaches/utils.py
+1
-2
1 addition, 2 deletions
coolamqp/attaches/utils.py
with
20 additions
and
10 deletions
coolamqp/attaches/declarer.py
+
17
−
6
View file @
0f80c4f1
...
...
@@ -45,14 +45,23 @@ class Operation(object):
def
span_exception
(
self
,
exception
):
if
self
.
parent_span
is
not
None
:
if
self
.
processing
_span
is
not
None
:
if
self
.
enqueued
_span
is
None
:
from
opentracing
import
tags
,
logs
self
.
processing
_span
.
set_tag
(
tags
.
ERROR
,
True
)
self
.
processing
_span
.
log_kv
({
logs
.
EVENT
:
tags
.
ERROR
,
self
.
enqueued
_span
.
set_tag
(
tags
.
ERROR
,
True
)
self
.
enqueued
_span
.
log_kv
({
logs
.
EVENT
:
tags
.
ERROR
,
logs
.
ERROR_KIND
:
exception
,
logs
.
ERROR_OBJECT
:
exception
})
self
.
processing_span
.
finish
()
self
.
processing_span
=
None
self
.
enqueued_span
.
finish
()
self
.
enqueued_span
=
None
if
self
.
processing_span
is
not
None
:
from
opentracing
import
tags
,
logs
self
.
processing_span
.
set_tag
(
tags
.
ERROR
,
True
)
self
.
processing_span
.
log_kv
({
logs
.
EVENT
:
tags
.
ERROR
,
logs
.
ERROR_KIND
:
exception
,
logs
.
ERROR_OBJECT
:
exception
})
self
.
processing_span
.
finish
()
self
.
processing_span
=
None
if
self
.
enqueued_span
is
not
None
:
self
.
enqueued_span
.
finish
()
self
.
enqueued_span
=
None
...
...
@@ -73,10 +82,12 @@ class Operation(object):
self
.
processing_span
=
self
.
declarer
.
cluster
.
tracer
.
start_span
(
'
Declaring
'
,
child_of
=
self
.
parent_span
,
references
=
follows_from
(
self
.
enqueued_span
))
self
.
enqueued_span
=
None
def
span_finished
(
self
):
if
self
.
p
arent
_span
is
None
:
if
self
.
p
rocessing
_span
is
None
:
self
.
processing_span
.
finish
()
self
.
processing_span
=
None
def
span_begin
(
self
):
if
self
.
enqueued_span
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
coolamqp/attaches/publisher.py
+
2
−
2
View file @
0f80c4f1
...
...
@@ -212,8 +212,8 @@ class Publisher(Channeler, Synchronized):
if
not
fut
.
set_running_or_notify_cancel
():
if
span_enqueued
is
not
None
:
import
opentracing
span_enqueued
.
log_kv
({
opentracing
.
logs
.
EVENT
:
'
Cancelled
'
})
from
opentracing
import
logs
span_enqueued
.
log_kv
({
logs
.
EVENT
:
'
Cancelled
'
})
span_enqueued
.
finish
()
parent_span
.
finish
()
continue
# cancelled
...
...
This diff is collapsed.
Click to expand it.
coolamqp/attaches/utils.py
+
1
−
2
View file @
0f80c4f1
...
...
@@ -135,8 +135,7 @@ class AtomicTagger(object):
i
=
len
(
self
.
tags
)
-
1
# start index
while
i
>
0
:
# this will terminate at i=0
if
self
.
tags
[
i
][
0
]
>
tag
:
# this means we should insert it here...
if
self
.
tags
[
i
][
0
]
>
tag
:
# this means we should insert it here...
break
i
-=
1
# previousl index
...
...
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