Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
beat
beat.web
Commits
2a712e43
There was a problem fetching the pipeline summary.
Commit
2a712e43
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[backend] Improve the handling of splits to be cancelled
parent
e8d1602b
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/backend/models.py
+15
-2
15 additions, 2 deletions
beat/web/backend/models.py
with
15 additions
and
2 deletions
beat/web/backend/models.py
+
15
−
2
View file @
2a712e43
...
@@ -434,9 +434,22 @@ class Worker(models.Model):
...
@@ -434,9 +434,22 @@ class Worker(models.Model):
# cancel job splits by killing associated processes
# cancel job splits by killing associated processes
for
j
in
JobSplit
.
objects
.
filter
(
worker
=
self
,
status
=
Job
.
CANCEL
,
for
j
in
JobSplit
.
objects
.
filter
(
worker
=
self
,
status
=
Job
.
CANCEL
,
end_date__isnull
=
True
,
process_id__isnull
=
False
):
end_date__isnull
=
True
):
if
psutil
.
pid_exists
(
j
.
process_id
):
if
j
.
process_id
is
not
None
and
psutil
.
pid_exists
(
j
.
process_id
):
os
.
kill
(
j
.
process_id
,
signal
.
SIGTERM
)
os
.
kill
(
j
.
process_id
,
signal
.
SIGTERM
)
else
:
# process went away without any apparent reason
with
transaction
.
atomic
():
message
=
"
Split %d/%d running at worker `%s
'
for
"
\
"
block `%s
'
of experiment `%s
'
finished without any
"
\
"
apparent reason. Checking-out job split at
"
\
"
database by force...
"
%
(
j
.
split_index
+
1
,
j
.
job
.
block
.
required_slots
,
self
,
j
.
job
.
block
.
name
,
j
.
job
.
block
.
experiment
.
fullname
(),
)
j
.
end
(
Result
(
status
=
1
,
usrerr
=
settings
.
DEFAULT_USER_ERROR
,
syserr
=
message
))
# cmdline base argument
# cmdline base argument
cmdline
=
[
process
]
cmdline
=
[
process
]
...
...
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