Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
15d09f16
authored
Sep 12, 2019
by
Chif Gergő
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'smallville_fix' into 'master'
Manager: increase timeout for deploy and destroy See merge request !408
parents
b9a4bf38
a58577ec
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
11 deletions
+20
-11
circle/firewall/tasks/local_tasks.py
+9
-3
circle/manager/mancelery.py
+2
-1
circle/storage/models.py
+3
-3
circle/vm/models/node.py
+1
-1
circle/vm/operations.py
+1
-1
circle/vm/tasks/local_periodic_tasks.py
+4
-2
No files found.
circle/firewall/tasks/local_tasks.py
View file @
15d09f16
...
...
@@ -39,7 +39,7 @@ def _apply_once(name, tasks, queues, task, data):
data
=
data
()
for
queue
in
queues
:
try
:
task
.
apply_async
(
args
=
data
,
queue
=
queue
,
expires
=
60
)
.
get
(
timeout
=
2
)
task
.
apply_async
(
args
=
data
,
queue
=
queue
,
expires
=
60
)
.
get
(
timeout
=
5
)
logger
.
info
(
"
%
s configuration is reloaded. (queue:
%
s)"
,
name
,
queue
)
except
TimeoutError
as
e
:
...
...
@@ -76,8 +76,14 @@ def reloadtask_worker():
logger
.
info
(
"reloadtask_worker: Reload
%
s"
,
", "
.
join
(
tasks
))
firewall_queues
=
get_firewall_queues
()
dns_queues
=
[(
"
%
s.dns"
%
i
)
for
i
in
settings
.
get
(
'dns_queues'
,
[
gethostname
()])]
dns_queues
=
settings
.
get
(
'dns_queues'
,
[
gethostname
()])
if
isinstance
(
dns_queues
,
(
str
,
unicode
)):
dns_queues
=
[
dns_queues
]
dns_queues
=
[(
"
%
s.dns"
%
i
)
for
i
in
dns_queues
]
# dns_queues = [("%s.dns" % i) for i in
# settings.get('dns_queues', [gethostname()])]
_apply_once
(
'dns'
,
tasks
,
dns_queues
,
reload_dns
,
lambda
:
(
dns
(),
))
...
...
circle/manager/mancelery.py
View file @
15d09f16
...
...
@@ -18,6 +18,7 @@
from
celery
import
Celery
from
celery.signals
import
worker_ready
from
datetime
import
timedelta
from
celery.schedules
import
crontab
from
kombu
import
Queue
,
Exchange
from
os
import
getenv
...
...
@@ -52,7 +53,7 @@ celery.conf.update(
'dashboard.send_email_notifications'
:
{
'task'
:
'dashboard.tasks.local_periodic_tasks.'
'send_email_notifications'
,
'schedule'
:
timedelta
(
hours
=
24
),
'schedule'
:
crontab
(
minute
=
10
,
hour
=
1
),
'options'
:
{
'queue'
:
'localhost.man'
}
},
}
...
...
circle/storage/models.py
View file @
15d09f16
...
...
@@ -86,7 +86,7 @@ class DataStore(Model):
args
=
[
self
.
path
],
queue
=
q
)
.
get
(
timeout
=
timeout
)
@method_cache
(
30
)
def
get_orphan_disks
(
self
,
timeout
=
1
5
):
def
get_orphan_disks
(
self
,
timeout
=
2
5
):
"""Disk image files without Disk object in the database.
"""
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
...
...
@@ -101,7 +101,7 @@ class DataStore(Model):
return
orphans
@method_cache
(
30
)
def
get_missing_disks
(
self
,
timeout
=
1
5
):
def
get_missing_disks
(
self
,
timeout
=
2
5
):
"""Disk objects without disk image files.
"""
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
...
...
@@ -111,7 +111,7 @@ class DataStore(Model):
return
disks
.
exclude
(
filename__in
=
files
)
@method_cache
(
120
)
def
get_file_statistics
(
self
,
timeout
=
3
0
):
def
get_file_statistics
(
self
,
timeout
=
9
0
):
queue_name
=
self
.
get_remote_queue_name
(
'storage'
,
"slow"
)
data
=
storage_tasks
.
get_file_statistics
.
apply_async
(
args
=
[
self
.
path
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
...
...
circle/vm/models/node.py
View file @
15d09f16
...
...
@@ -349,7 +349,7 @@ class Node(OperatedMixin, TimeStampedModel):
continue
value
=
target
[
'datapoints'
][
-
2
][
0
]
retval
[
metric
]
=
float
(
value
)
except
(
KeyError
,
IndexError
,
ValueError
):
except
(
KeyError
,
IndexError
,
ValueError
,
TypeError
):
continue
return
retval
...
...
circle/vm/operations.py
View file @
15d09f16
...
...
@@ -421,7 +421,7 @@ class DeployOperation(InstanceOperation):
description
=
_
(
"Deploy virtual machine."
)
remote_queue
=
(
"vm"
,
"slow"
)
task
=
vm_tasks
.
deploy
remote_timeout
=
120
def
_get_remote_args
(
self
,
**
kwargs
):
return
[
self
.
instance
.
get_vm_desc
()]
# intentionally not calling super
...
...
circle/vm/tasks/local_periodic_tasks.py
View file @
15d09f16
...
...
@@ -58,9 +58,9 @@ def garbage_collector(timeout=15):
i
.
pk
,
unicode
(
e
))
elif
(
i
.
time_of_suspend
and
now
>
i
.
time_of_suspend
and
i
.
state
==
'RUNNING'
):
i
.
sleep
.
async
(
system
=
True
)
logger
.
info
(
"Expired instance
%
d suspended."
%
i
.
pk
)
try
:
i
.
sleep
.
async
(
system
=
True
)
i
.
owner
.
profile
.
notify
(
ugettext_noop
(
'
%(instance)
s suspended'
),
ugettext_noop
(
...
...
@@ -68,8 +68,10 @@ def garbage_collector(timeout=15):
'has been suspended due to expiration. '
'You can resume or destroy it.'
),
instance
=
i
.
name
,
url
=
i
.
get_absolute_url
())
except
ActivityInProgressError
:
logger
.
error
(
"Expired instance
%
d can't be destroyed due the AtctivityInPorgressError."
,
i
.
pk
)
except
Exception
as
e
:
logger
.
debug
(
'Could not notify owner of instance
%
d .
%
s'
,
logger
.
info
(
'Could not notify owner of instance
%
d .
%
s'
,
i
.
pk
,
unicode
(
e
))
elif
i
.
is_expiring
():
logger
.
debug
(
"Instance
%
d expires soon."
%
i
.
pk
)
...
...
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