Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
506cff12
Commit
506cff12
authored
Sep 09, 2008
by
Michael Hanselmann
Browse files
Use lock timeout for queue updates in ganeti-noded
This helps to prevent complete deadlocks. Reviewed-by: iustinp
parent
86de84dd
Changes
1
Show whitespace changes
Inline
Side-by-side
daemons/ganeti-noded
View file @
506cff12
...
@@ -54,9 +54,8 @@ def _RequireJobQueueLock(fn):
...
@@ -54,9 +54,8 @@ def _RequireJobQueueLock(fn):
"""
"""
def
wrapper
(
*
args
,
**
kwargs
):
def
wrapper
(
*
args
,
**
kwargs
):
# Locking in exclusive, blocking mode because there could be several
# Locking in exclusive, blocking mode because there could be several
# children running at the same time.
# children running at the same time. Waiting up to 10 seconds.
# TODO: Implement nonblocking locking with retries?
queue_lock
.
Exclusive
(
blocking
=
True
,
timeout
=
10
)
queue_lock
.
Exclusive
(
blocking
=
True
)
try
:
try
:
return
fn
(
*
args
,
**
kwargs
)
return
fn
(
*
args
,
**
kwargs
)
finally
:
finally
:
...
...
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