Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
job-pattern-rule-evaluation-wip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PathoJobs
job-pattern-rule-evaluation-wip
Commits
c205c9d2
Commit
c205c9d2
authored
5 months ago
by
Alex Wiens
Browse files
Options
Downloads
Patches
Plain Diff
Prule.daemon: Add exception traceback printing
parent
bcfac185
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
prule/daemon/__main__.py
+12
-1
12 additions, 1 deletion
prule/daemon/__main__.py
with
12 additions
and
1 deletion
prule/daemon/__main__.py
+
12
−
1
View file @
c205c9d2
...
@@ -185,6 +185,7 @@ class JobQueue:
...
@@ -185,6 +185,7 @@ class JobQueue:
with
open
(
path
,
"
r
"
)
as
f
:
with
open
(
path
,
"
r
"
)
as
f
:
data
=
json
.
load
(
f
)
data
=
json
.
load
(
f
)
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
return
False
return
False
self
.
smallest_starttime
=
data
[
"
smallest_starttime
"
]
self
.
smallest_starttime
=
data
[
"
smallest_starttime
"
]
...
@@ -209,6 +210,7 @@ class JobQueue:
...
@@ -209,6 +210,7 @@ class JobQueue:
json
.
dump
(
data
,
f
)
json
.
dump
(
data
,
f
)
print
(
"
Saved state to {}.
"
.
format
(
path
))
print
(
"
Saved state to {}.
"
.
format
(
path
))
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
print
(
"
Failed to save the state to {}:
"
.
format
(
path
))
print
(
"
Failed to save the state to {}:
"
.
format
(
path
))
print
(
data
)
print
(
data
)
...
@@ -360,14 +362,15 @@ class CCCheckThread(threading.Thread):
...
@@ -360,14 +362,15 @@ class CCCheckThread(threading.Thread):
signal
.
pthread_kill
(
config
.
main_tid
,
signal
.
SIGTERM
)
# shutdown
signal
.
pthread_kill
(
config
.
main_tid
,
signal
.
SIGTERM
)
# shutdown
return
None
return
None
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
#traceback.print_exc()
#traceback.print_exc()
return
None
return
None
with
self
.
stopCondition
:
with
self
.
stopCondition
:
self
.
requestFuture
=
self
.
executor
.
submit
(
execRequest
,
req
)
self
.
requestFuture
=
self
.
executor
.
submit
(
execRequest
,
req
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
traceback
.
print_exc
()
traceback
.
print_exc
()
print
(
e
)
return
None
return
None
#await self.requestTask
#await self.requestTask
...
@@ -537,6 +540,7 @@ class PruleThread(threading.Thread):
...
@@ -537,6 +540,7 @@ class PruleThread(threading.Thread):
return
"
wait
"
return
"
wait
"
return
None
return
None
except
Exception
as
e
:
# something went horribly wrong
except
Exception
as
e
:
# something went horribly wrong
traceback
.
print_exc
()
print
(
"
request_job_meta
"
,
e
)
print
(
"
request_job_meta
"
,
e
)
return
None
return
None
return
None
return
None
...
@@ -571,6 +575,7 @@ class PruleThread(threading.Thread):
...
@@ -571,6 +575,7 @@ class PruleThread(threading.Thread):
return
True
return
True
return
False
return
False
except
Exception
as
e
:
# something went horribly wrong
except
Exception
as
e
:
# something went horribly wrong
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
return
False
return
False
return
False
return
False
...
@@ -606,6 +611,7 @@ class PruleThread(threading.Thread):
...
@@ -606,6 +611,7 @@ class PruleThread(threading.Thread):
return
"
wait
"
return
"
wait
"
return
False
return
False
except
Exception
as
e
:
# something went horribly wrong
except
Exception
as
e
:
# something went horribly wrong
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
tdir
.
cleanup
()
tdir
.
cleanup
()
return
False
return
False
...
@@ -633,6 +639,7 @@ class PruleThread(threading.Thread):
...
@@ -633,6 +639,7 @@ class PruleThread(threading.Thread):
signal
.
pthread_kill
(
config
.
main_tid
,
signal
.
SIGTERM
)
# shutdown
signal
.
pthread_kill
(
config
.
main_tid
,
signal
.
SIGTERM
)
# shutdown
return
False
return
False
except
Exception
as
e
:
# something went horribly wrong
except
Exception
as
e
:
# something went horribly wrong
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
return
False
return
False
return
False
return
False
...
@@ -666,6 +673,7 @@ class PruleThread(threading.Thread):
...
@@ -666,6 +673,7 @@ class PruleThread(threading.Thread):
result
=
json
.
loads
(
line
)
result
=
json
.
loads
(
line
)
break
break
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
if
self
.
stopThread
==
True
:
if
self
.
stopThread
==
True
:
return
(
None
,
0.0
)
return
(
None
,
0.0
)
...
@@ -792,6 +800,7 @@ class PruleThread(threading.Thread):
...
@@ -792,6 +800,7 @@ class PruleThread(threading.Thread):
result_json
[
"
evaluation_time
"
]
result_json
[
"
evaluation_time
"
]
))
))
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
print
(
"
Job {} process result {}
"
.
format
(
job
.
ccjobid
,
result_json
))
print
(
"
Job {} process result {}
"
.
format
(
job
.
ccjobid
,
result_json
))
...
@@ -831,6 +840,7 @@ class PruleThread(threading.Thread):
...
@@ -831,6 +840,7 @@ class PruleThread(threading.Thread):
with
prule
.
debug
.
Timing
(
"
prulethread.db_insert_result
"
,
"
PRINT_TIMING
"
in
config
.
config
):
with
prule
.
debug
.
Timing
(
"
prulethread.db_insert_result
"
,
"
PRINT_TIMING
"
in
config
.
config
):
self
.
db_con
.
db_insert_result
(
job
.
ccjobid
,
result_json
,
job_meta
,
process_time
,
evaluated
)
self
.
db_con
.
db_insert_result
(
job
.
ccjobid
,
result_json
,
job_meta
,
process_time
,
evaluated
)
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
print
(
"
ERROR: db_insert_result failed for job ccid {}
"
.
format
(
job
.
ccjobid
))
print
(
"
ERROR: db_insert_result failed for job ccid {}
"
.
format
(
job
.
ccjobid
))
process_result
=
"
failure-shutdown
"
process_result
=
"
failure-shutdown
"
...
@@ -924,6 +934,7 @@ class PruleThread(threading.Thread):
...
@@ -924,6 +934,7 @@ class PruleThread(threading.Thread):
with
prule
.
debug
.
Timing
(
"
prulethread.db_insert_failure
"
,
"
PRINT_TIMING
"
in
config
.
config
):
with
prule
.
debug
.
Timing
(
"
prulethread.db_insert_failure
"
,
"
PRINT_TIMING
"
in
config
.
config
):
self
.
db_con
.
db_insert_failure
(
job
.
ccjobid
)
self
.
db_con
.
db_insert_failure
(
job
.
ccjobid
)
except
Exception
as
e
:
except
Exception
as
e
:
traceback
.
print_exc
()
print
(
e
)
print
(
e
)
print
(
"
ERROR: db_insert_failure failed for job ccid {}, requeue
"
.
format
(
job
.
ccjobid
))
print
(
"
ERROR: db_insert_failure failed for job ccid {}, requeue
"
.
format
(
job
.
ccjobid
))
queue
.
add
(
job
)
queue
.
add
(
job
)
...
...
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