Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
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
Mirror
cc-node
Commits
d9b83cf9
Commit
d9b83cf9
authored
13 years ago
by
Thibault VINCENT
Browse files
Options
Downloads
Patches
Plain Diff
fix: scheduler timer locking, tried to correct problems after successive reconnections
parent
930a5cbd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ccnode/ccnode.py
+12
-5
12 additions, 5 deletions
ccnode/ccnode.py
with
12 additions
and
5 deletions
ccnode/ccnode.py
+
12
−
5
View file @
d9b83cf9
# -*- coding: utf-8 -*-
import
logging
from
threading
import
Timer
,
Lock
from
threading
import
Timer
,
Lock
,
Event
from
time
import
sleep
from
sjrpc.client
import
SimpleRpcClient
from
sjrpc.utils
import
ConnectionProxy
...
...
@@ -18,6 +18,7 @@ class CCNode(object):
'''
self
.
_scheduler_timer
=
None
self
.
_scheduler_mutex
=
Lock
()
self
.
_scheduler_stopped
=
Event
()
self
.
_handler
=
handlers
.
NodeHandler
(
self
,
hypervisor
,
exec_cmd
,
force_xen
)
self
.
_manager
=
SimpleRpcClient
.
from_addr
(
server
,
port
,
enable_ssl
=
True
,
...
...
@@ -27,7 +28,12 @@ class CCNode(object):
def
run
(
self
):
'''
'''
self
.
_manager
.
run
()
try
:
self
.
_manager
.
run
()
except
:
pass
# FIXME
finally
:
self
.
_scheduler_stopped
.
set
()
def
authentify
(
self
,
login
,
password
):
'''
...
...
@@ -62,9 +68,10 @@ class CCNode(object):
'''
'''
with
self
.
_scheduler_mutex
:
self
.
_handler
.
scheduler_run
()
sleep
(
0.1
)
self
.
_scheduler_rearm
()
if
not
self
.
_scheduler_stopped
.
is_set
():
self
.
_handler
.
scheduler_run
()
sleep
(
0.1
)
self
.
_scheduler_rearm
()
def
get_server
(
self
):
'''
...
...
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