Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
Log MatomNom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libre
Log MatomNom
Commits
83dc4901
Commit
83dc4901
authored
Nov 27, 2020
by
Michał Woźniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP:
#7
queue.put() improvement, and a bit better debug output around BailException
parent
9ad9888e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
logwatch.py
logwatch.py
+6
-1
No files found.
logwatch.py
View file @
83dc4901
...
...
@@ -37,7 +37,7 @@ def excinit(self, *args, **kwargs):
try
:
_run
(
*
args
,
**
kwargs
)
except
BailException
:
logging
.
debug
(
'BailException caught'
)
logging
.
debug
(
'BailException caught
in a subthread
'
)
self
.
run
=
run
# we're monkey patching a module imported in a module we import
# this is absolutely haram
...
...
@@ -292,6 +292,9 @@ class EmptyQueue(object):
def
join
(
self
):
raise
BailException
()
def
emptyput
(
arg
):
raise
BailException
()
# monkey-patching fatal_error() so that we can handle ingestion errors gracefully
#
# first, define a replacement
...
...
@@ -319,6 +322,7 @@ def non_fatal_error(error, filename=None, lineno=None):
logging
.
debug
(
'fatal_error(): not fatal'
)
for
r
in
import_logs
.
Recorder
.
recorders
:
logging
.
debug
(
'fatal_error(): in for'
)
r
.
queue
.
put
=
emptyput
r
.
queue
.
task_done
()
while
not
r
.
queue
.
empty
():
logging
.
debug
(
'fatal_error(): in while'
)
...
...
@@ -452,6 +456,7 @@ while True:
parser
.
parse
(
f
)
import_logs
.
Recorder
.
wait_empty
()
except
BailException
:
logging
.
debug
(
'BailException caught in main thread'
)
pass
logging
.
debug
(
"after import_logs.Recorder.wait_empty()"
)
if
hasattr
(
import_logs
.
Recorder
,
"exc"
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment