Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
record
workbench4record
Commits
9f47484d
Commit
9f47484d
authored
Oct 08, 2018
by
mvdbeek
Committed by
Chabrier Patrick
Oct 12, 2018
Browse files
Register job monitor as postfork function
parent
4a345b99
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/galaxy/jobs/handler.py
View file @
9f47484d
...
...
@@ -209,7 +209,7 @@ class JobHandlerQueue(Monitors):
try
:
# If jobs are locked, there's nothing to monitor and we skip
# to the sleep.
if
not
self
.
app
.
job_manager
.
job_lock
:
if
hasattr
(
self
.
app
,
'job_manager'
)
and
not
self
.
app
.
job_manager
.
job_lock
:
self
.
__monitor_step
()
except
Exception
:
log
.
exception
(
"Exception in monitor_step"
)
...
...
lib/galaxy/util/monitors.py
View file @
9f47484d
...
...
@@ -3,6 +3,7 @@ from __future__ import absolute_import
import
logging
import
threading
from
galaxy.web.stack
import
register_postfork_function
from
.sleeper
import
Sleeper
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -27,7 +28,11 @@ class Monitors(object):
self
.
sleeper
=
Sleeper
()
self
.
monitor_thread
=
threading
.
Thread
(
name
=
name
,
target
=
monitor_func
)
self
.
monitor_thread
.
setDaemon
(
True
)
if
start
:
self
.
_start
=
start
register_postfork_function
(
self
.
start_monitoring
)
def
start_monitoring
(
self
):
if
self
.
_start
:
self
.
monitor_thread
.
start
()
def
stop_monitoring
(
self
):
...
...
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