Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
codejail
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
codejail
Commits
0f071168
Commit
0f071168
authored
Jul 03, 2013
by
brianhw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10 from edx/fix/brian/remove_warning
Return log warning to debug level.
parents
0a1b468d
d820e6c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
AUTHORS
+1
-0
codejail/jail_code.py
+3
-3
codejail/safe_exec.py
+1
-1
No files found.
AUTHORS
View file @
0f071168
Ned Batchelder <ned@nedbatchelder.com>
Will Daly <will@edx.org>
Brian Wilson <brian@edx.org>
codejail/jail_code.py
View file @
0f071168
...
...
@@ -152,7 +152,7 @@ def jail_code(command, code=None, files=None, argv=None, stdin=None,
with
temp_directory
()
as
tmpdir
:
if
slug
:
log
.
warnin
g
(
"Executing jailed code
%
s in
%
s"
,
slug
,
tmpdir
)
log
.
debu
g
(
"Executing jailed code
%
s in
%
s"
,
slug
,
tmpdir
)
argv
=
argv
or
[]
...
...
@@ -196,7 +196,7 @@ def jail_code(command, code=None, files=None, argv=None, stdin=None,
def
set_process_limits
():
# pragma: no cover
"""
Set limits on this process
s
, to be used first in a child process.
Set limits on this process, to be used first in a child process.
"""
# Set a new session id so that this process and all its children will be
# in a new process group, so we can kill them all later if we need to.
...
...
@@ -239,6 +239,6 @@ class ProcessKillerThread(threading.Thread):
pgid
=
os
.
getpgid
(
self
.
subproc
.
pid
)
log
.
warning
(
"Killing process
%
r (group
%
r), ran too long:
%.1
fs"
,
self
.
subproc
.
pid
,
pgid
,
time
.
time
()
-
start
self
.
subproc
.
pid
,
pgid
,
time
.
time
()
-
start
)
subprocess
.
call
([
"sudo"
,
"pkill"
,
"-9"
,
"-g"
,
str
(
pgid
)])
codejail/safe_exec.py
View file @
0f071168
...
...
@@ -222,7 +222,7 @@ if UNSAFE: # pragma: no cover
"""An actually-unsafe safe_exec, that warns it's being used."""
# Because it would be bad if this function were used in production,
# let's log a warning when it is used. Developers can
can
live with
# let's log a warning when it is used. Developers can live with
# one more log line.
slug
=
kwargs
.
get
(
'slug'
,
None
)
log
.
warning
(
"Using codejail/safe_exec.py:not_safe_exec for
%
s"
,
slug
)
...
...
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