ShaoHe Feng has uploaded a new change for review.

Change subject: get max_tasks and thread_pool_size from config by getint()
......................................................................

get max_tasks and thread_pool_size from config by getint()

It is OK to get max_tasks and thread_pool_size by getfloat()

The max_tasks will be passed to the Queue as maxsize and the
thread_pool_size is the thread number of the task thread pool.

So int is more reasonable than float

Change-Id: I9fc719b1b4238b0df2d9c882777cb75d7a27d4df
Signed-off-by: ShaoHe Feng <[email protected]>
---
M vdsm/storage/storage_mailbox.py
M vdsm/storage/taskManager.py
2 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/9035/1

diff --git a/vdsm/storage/storage_mailbox.py b/vdsm/storage/storage_mailbox.py
index c537883..1c8700d 100644
--- a/vdsm/storage/storage_mailbox.py
+++ b/vdsm/storage/storage_mailbox.py
@@ -208,9 +208,9 @@
 
     def __init__(self, inbox, outbox, hostID, queue, monitorInterval):
         # Save arguments
-        tpSize = config.getfloat('irs', 'thread_pool_size') / 2
+        tpSize = config.getint('irs', 'thread_pool_size') / 2
         waitTimeout = 3
-        maxTasks = config.getfloat('irs', 'max_tasks')
+        maxTasks = config.getint('irs', 'max_tasks')
         self.tp = ThreadPool(tpSize, waitTimeout, maxTasks)
         self._stop = False
         self._flush = False
@@ -466,9 +466,9 @@
         self._stopped = False
         self._poolID = str(pool.spUUID)
         self._spmStorageDir = pool.storage_repository
-        tpSize = config.getfloat('irs', 'thread_pool_size') / 2
+        tpSize = config.getint('irs', 'thread_pool_size') / 2
         waitTimeout = 3
-        maxTasks = config.getfloat('irs', 'max_tasks')
+        maxTasks = config.getint('irs', 'max_tasks')
         self.tp = ThreadPool(tpSize, waitTimeout, maxTasks)
         #  *** IMPORTANT NOTE: The SPM's inbox is the HSMs' outbox and vice 
versa *** #
         self._inbox = os.path.join(self._spmStorageDir, self._poolID, 
"mastersd", sd.DOMAIN_META_DATA, "inbox")
diff --git a/vdsm/storage/taskManager.py b/vdsm/storage/taskManager.py
index 3bc12f3..f7a5da2 100644
--- a/vdsm/storage/taskManager.py
+++ b/vdsm/storage/taskManager.py
@@ -31,9 +31,9 @@
     log = logging.getLogger('TaskManager')
 
     def __init__(self,
-                 tpSize=config.getfloat('irs', 'thread_pool_size'),
+                 tpSize=config.getint('irs', 'thread_pool_size'),
                  waitTimeout=3,
-                 maxTasks=config.getfloat('irs', 'max_tasks')):
+                 maxTasks=config.getint('irs', 'max_tasks')):
         self.storage_repository = config.get('irs', 'repository')
         self.tp = ThreadPool(tpSize, waitTimeout, maxTasks)
         self._tasks = {}


--
To view, visit http://gerrit.ovirt.org/9035
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fc719b1b4238b0df2d9c882777cb75d7a27d4df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to