change the queue_masize parameter to uncustomizable

based on the pacth content, rm the 0006-fix-data-duplication-issue.patch and add a new patch 0006-fix-memory_caused-service-crash-and-data-duplication-issue.patch into pkgship, which change the the queue_masize parameter to uncustomizable
This commit is contained in:
Yiru Wang Mac 2020-09-24 16:31:52 +08:00
parent 5f98c47f02
commit da8b6c00a5
2 changed files with 8 additions and 20 deletions

View File

@ -1,7 +1,7 @@
diff -Naru a/packageship/application/apps/lifecycle/function/concurrent.py b/packageship/application/apps/lifecycle/function/concurrent.py
--- a/packageship/application/apps/lifecycle/function/concurrent.py 2020-09-22 23:34:04.037937224 +0800
+++ b/packageship/application/apps/lifecycle/function/concurrent.py 2020-09-22 23:48:39.938515522 +0800
@@ -1,65 +1,80 @@
@@ -1,65 +1,76 @@
-#!/usr/bin/python3
-"""
-Use queues to implement the producer and consumer model
@ -89,11 +89,7 @@ diff -Naru a/packageship/application/apps/lifecycle/function/concurrent.py b/pac
+ concurrency queue, and the high concurrency is solved
+ by the form of the queue
+ """
+ _readconfig = ReadConfig(system_config.SYS_CONFIG_PATH)
+ queue_maxsize = int(_readconfig.get_config('LIFECYCLE', 'queue_maxsize'))
+ if not isinstance(queue_maxsize, int):
+ queue_maxsize = 1000
+ _queue = Queue(maxsize=queue_maxsize)
+ _queue = Queue(maxsize=1000)
+ _instance_lock = threading.Lock()
+ _log = Log(__name__)
+
@ -2971,16 +2967,6 @@ diff -Naru a/packageship/libs/dbutils/sqlalchemy_helper.py b/packageship/libs/db
raise Error(sql_error)
else:
self.session.commit()
diff -Naru a/packageship/package.ini b/packageship/package.ini
--- a/packageship/package.ini 2020-09-22 23:34:04.037937224 +0800
+++ b/packageship/package.ini 2020-09-22 23:49:12.154683915 +0800
@@ -93,3 +93,5 @@
; When this value is not set, the system will default to src-openeuler
warehouse=src-openeuler
+; Maximum queue length
+queue_maxsize = 1000
\ No newline at end of file
diff -Naru a/packageship/pkgshipd b/packageship/pkgshipd
--- a/packageship/pkgshipd 2020-09-22 23:34:04.037937224 +0800
+++ b/packageship/pkgshipd 2020-09-22 23:51:57.323547247 +0800
@ -3006,7 +2992,7 @@ diff -Naru a/packageship/pkgshipd b/packageship/pkgshipd
diff -Naru a/test/common_files/package.ini b/test/common_files/package.ini
--- a/test/common_files/package.ini 2020-09-22 23:34:04.041937245 +0800
+++ b/test/common_files/package.ini 2020-09-22 23:50:56.559229634 +0800
@@ -1,30 +1,31 @@
@@ -1,30 +1,30 @@
-[SYSTEM]
-init_conf_path = C:\Users\TAO\Desktop\pkgship-1.1.0\test\common_files\conf.yaml
-write_port = 8080
@ -3066,5 +3052,4 @@ diff -Naru a/test/common_files/package.ini b/test/common_files/package.ini
+warehouse_remote = https://gitee.com/openeuler/openEuler-Advisor/raw/master/upstream-info/
+pool_workers = 10
+warehouse = src-openeuler
+queue_maxsize = 1000
+

View File

@ -1,6 +1,6 @@
Name: pkgship
Version: 1.1.0
Release: 9
Release: 10
Summary: Pkgship implements rpm package dependence ,maintainer, patch query and so no.
License: Mulan 2.0
URL: https://gitee.com/openeuler/openEuler-Advisor
@ -26,7 +26,7 @@ Patch4: 0005-fix-the-error-when-source-package-has-no-sub-packages.patch
# Solve the problem of data duplication, increase the maximum queue length judgment,
# and avoid occupying too much memory
Patch5: 0006-fix-data-duplication-issue.patch
Patch5: 0006-fix-memory_caused-service-crash-and-data-duplication-issue.patch
BuildArch: noarch
BuildRequires: python3-flask-restful python3-flask python3 python3-pyyaml python3-sqlalchemy
@ -75,6 +75,9 @@ rm -rf $log_path
%attr(0755,root,root) %{_bindir}/pkgship
%changelog
* Thu Sep 24 2020 Yiru Wang <wangyiru1@huawei.com> - 1.1.0-10
- rm queue_maxsize param from package.ini and this parameter is not customizable
* Tue Sep 21 2020 Shenmei Tu <tushenmei@huawei.com> - 1.0-0-9
- Solve the problem of data duplication, increase the maximum queue length judgment,
- and avoid occupying too much memory