Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Runner Mirror
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
Adrian Schmitz
Runner Mirror
Commits
a1af5de0
Commit
a1af5de0
authored
1 year ago
by
Felix Tomski
Browse files
Options
Downloads
Patches
Plain Diff
Dirty fix for data race on concurrent tmp
parent
f090741f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/job.py
+5
-3
5 additions, 3 deletions
core/job.py
core/utility/defines.py
+3
-0
3 additions, 0 deletions
core/utility/defines.py
with
8 additions
and
3 deletions
core/job.py
+
5
−
3
View file @
a1af5de0
...
@@ -3,7 +3,7 @@ import subprocess
...
@@ -3,7 +3,7 @@ import subprocess
import
os
import
os
import
logging
import
logging
import
sys
import
sys
from
time
import
sleep
import
time
import
importlib.resources
as
importlib_resources
import
importlib.resources
as
importlib_resources
import
core.modes
as
modes
import
core.modes
as
modes
...
@@ -64,7 +64,7 @@ class Job:
...
@@ -64,7 +64,7 @@ class Job:
pdb_attach
.
listen
(
port
)
pdb_attach
.
listen
(
port
)
if
self
.
args
[
1
]
!=
'
config
'
:
if
self
.
args
[
1
]
!=
'
config
'
:
logging
.
debug
(
f
'
Debug mode on listening on port
{
port
}
'
)
logging
.
debug
(
f
'
Debug mode on listening on port
{
port
}
'
)
sleep
(
100
)
time
.
sleep
(
100
)
except
ImportError
:
except
ImportError
:
if
self
.
args
[
1
]
!=
'
config
'
:
if
self
.
args
[
1
]
!=
'
config
'
:
logging
.
warning
(
'
Debug mode on but pdb_attach module not found
'
)
logging
.
warning
(
'
Debug mode on but pdb_attach module not found
'
)
...
@@ -167,8 +167,10 @@ class Job:
...
@@ -167,8 +167,10 @@ class Job:
def
prepare
(
self
):
def
prepare
(
self
):
if
os
.
path
.
isdir
(
self
.
concurrent_tmp
):
if
os
.
path
.
isdir
(
self
.
concurrent_tmp
):
now
=
time
.
time
()
for
p
in
os
.
listdir
(
f
'
{
self
.
concurrent_tmp
}
'
):
for
p
in
os
.
listdir
(
f
'
{
self
.
concurrent_tmp
}
'
):
if
p
!=
self
.
pipeline_id
and
os
.
path
.
isdir
(
f
'
{
self
.
concurrent_tmp
}
/
{
p
}
'
):
if
(
p
!=
self
.
pipeline_id
and
os
.
path
.
isdir
(
f
'
{
self
.
concurrent_tmp
}
/
{
p
}
'
)
and
os
.
stat
(
f
'
{
self
.
concurrent_tmp
}
/
{
p
}
'
).
st_mtime
<
(
now
-
defines
.
cc_tmp_del_range
*
defines
.
seconds_per_day
)):
logging
.
debug
(
f
'
Removing concurrent_tmp:
{
self
.
concurrent_tmp
}
/
{
p
}
'
)
logging
.
debug
(
f
'
Removing concurrent_tmp:
{
self
.
concurrent_tmp
}
/
{
p
}
'
)
os
.
system
(
f
'
rm -r
{
self
.
concurrent_tmp
}
/
{
p
}
'
)
os
.
system
(
f
'
rm -r
{
self
.
concurrent_tmp
}
/
{
p
}
'
)
...
...
This diff is collapsed.
Click to expand it.
core/utility/defines.py
+
3
−
0
View file @
a1af5de0
...
@@ -5,3 +5,6 @@ version = '0.5.4'
...
@@ -5,3 +5,6 @@ version = '0.5.4'
debug
=
False
debug
=
False
stdout_logging
=
False
stdout_logging
=
False
log_level
=
logging
.
DEBUG
log_level
=
logging
.
DEBUG
seconds_per_day
=
86400
cc_tmp_del_range
=
2
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