Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
locklost
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue 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
Benjamin Mannix
locklost
Commits
fc0e63fc
Commit
fc0e63fc
authored
4 years ago
by
lockloss
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in lock checking
parent
4e4b9c16
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
locklost/condor.py
+7
-4
7 additions, 4 deletions
locklost/condor.py
with
7 additions
and
4 deletions
locklost/condor.py
+
7
−
4
View file @
fc0e63fc
...
...
@@ -167,14 +167,17 @@ RETRY {jid} 1
logging
.
info
(
"
condor DAG {} jobs
"
.
format
(
jid
+
1
))
return
s
@property
def
lock
(
self
):
return
os
.
path
.
join
(
self
.
condor_dir
,
'
dag.lock
'
)
@property
def
has_lock
(
self
):
lock
=
os
.
path
.
join
(
self
.
condor_dir
,
'
dag.lock
'
)
return
os
.
path
.
exists
(
lock
)
return
os
.
path
.
exists
(
self
.
lock
)
def
write
(
self
):
if
self
.
has_lock
:
raise
RuntimeError
(
"
DAG already running: {}
"
.
format
(
lock
))
raise
RuntimeError
(
"
DAG already running: {}
"
.
format
(
self
.
lock
))
shutil
.
rmtree
(
self
.
condor_dir
)
try
:
os
.
makedirs
(
os
.
path
.
join
(
self
.
condor_dir
,
'
logs
'
))
...
...
@@ -187,7 +190,7 @@ RETRY {jid} 1
def
submit
(
self
):
assert
os
.
path
.
exists
(
self
.
dag_path
),
"
Must write() before submitting
"
if
self
.
has_lock
:
raise
RuntimeError
(
"
DAG already running: {}
"
.
format
(
lock
))
raise
RuntimeError
(
"
DAG already running: {}
"
.
format
(
self
.
lock
))
logging
.
info
(
"
condor submit dag: {}
"
.
format
(
self
.
dag_path
))
subprocess
.
call
([
'
condor_submit_dag
'
,
self
.
dag_path
])
print
(
"""
...
...
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