opengris-scaler 1.12.7__cp312-cp312-manylinux_2_28_x86_64.whl → 1.12.9__cp312-cp312-manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of opengris-scaler might be problematic. Click here for more details.
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/METADATA +1 -1
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/RECORD +19 -20
- scaler/config/loader.py +3 -2
- scaler/config/mixins.py +6 -1
- scaler/config/types/worker.py +6 -1
- scaler/config/types/zmq.py +5 -1
- scaler/io/ymq/CMakeLists.txt +0 -1
- scaler/io/ymq/epoll_context.h +0 -1
- scaler/object_storage/CMakeLists.txt +0 -2
- scaler/object_storage/object_storage_server.cpp +11 -4
- scaler/object_storage/object_storage_server.h +3 -2
- scaler/object_storage/object_storage_server.so +0 -0
- scaler/object_storage/pymod_object_storage_server.cpp +13 -2
- scaler/version.txt +1 -1
- scaler/io/ymq/file_descriptor.h +0 -203
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/WHEEL +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/entry_points.txt +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/licenses/LICENSE +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/licenses/LICENSE.spdx +0 -0
- {opengris_scaler-1.12.7.dist-info → opengris_scaler-1.12.9.dist-info}/licenses/NOTICE +0 -0
|
@@ -3,7 +3,7 @@ opengris_scaler.libs/libkj-1-094aa318.1.0.so,sha256=dRbFbTaca-2vf1SS5LDL3WNfPzoE
|
|
|
3
3
|
scaler/CMakeLists.txt,sha256=60rkhpiwy0F-DSsRX_6nRrjYQvQ1Jp9mGp8fZsi006k,305
|
|
4
4
|
scaler/__init__.py,sha256=nZU5QZ9oW2YIaGwm3-r-6dfmirTVzZpDPDNtX-ITCV4,513
|
|
5
5
|
scaler/about.py,sha256=OBcfSvHO0P3mWaa2Ci4WEOTbH7is-3uYymScxgZPxyg,161
|
|
6
|
-
scaler/version.txt,sha256=
|
|
6
|
+
scaler/version.txt,sha256=BapNVsomB8f82_4o6SME3mmtU8l5mwsJj9b5hMy6ADk,7
|
|
7
7
|
scaler/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
scaler/client/client.py,sha256=uyYVNYhLaX3H-Aqecf-yHSqvkKnWeDzpTr2atNUUv0E,24373
|
|
9
9
|
scaler/client/future.py,sha256=fOl5g4Is4E5jtvO0kmRk4uUs_eUjSjMmyniYhWMAH4w,10041
|
|
@@ -27,8 +27,8 @@ scaler/cluster/object_storage_server.py,sha256=t7lx1tXAz1Iwc3xARJQqQOcG0s1BlIc-y
|
|
|
27
27
|
scaler/cluster/scheduler.py,sha256=UqrB2ApZ9D_2IhleyGzKgZRUda5PPBiSOHO-Z0hj72k,3267
|
|
28
28
|
scaler/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
scaler/config/defaults.py,sha256=HhYpemdTj1LQUZx8Fga5zVvCeIld1vvaNhTPjP2sRB4,2865
|
|
30
|
-
scaler/config/loader.py,sha256=
|
|
31
|
-
scaler/config/mixins.py,sha256=
|
|
30
|
+
scaler/config/loader.py,sha256=nQXS7ysT5p-IVTjVTzfC19ZDdsQPBh1lnD-MX7DVHL4,3866
|
|
31
|
+
scaler/config/mixins.py,sha256=o1YivS_8AzejSQ_jfSt5bkaA59DQGbw9P-rO5Z7LFVs,443
|
|
32
32
|
scaler/config/section/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
scaler/config/section/cluster.py,sha256=JTn3rFM5HaOGyM-r9yd2xgImLgL9YJBkQPsAEDOXCd8,2855
|
|
34
34
|
scaler/config/section/native_worker_adapter.py,sha256=dYPJn3a8CrGlynrlD4NlPRfA8PBkmcERPecRdf_hKWg,2262
|
|
@@ -39,8 +39,8 @@ scaler/config/section/top.py,sha256=4YUCyZTRVfINUhV56j50pg8be5o8nlWxG08fDqofHrA,
|
|
|
39
39
|
scaler/config/section/webui.py,sha256=-9oFn1C64re2xZ_KKJIsHG--6PaVTvCP9vmRZNR_9MA,487
|
|
40
40
|
scaler/config/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
scaler/config/types/object_storage_server.py,sha256=xvuCwiAQ4C_hKgTI4y6XMx9NKE0aX2QC6dlWNyvJyk4,1338
|
|
42
|
-
scaler/config/types/worker.py,sha256=
|
|
43
|
-
scaler/config/types/zmq.py,sha256=
|
|
42
|
+
scaler/config/types/worker.py,sha256=0pt871QcyQ0_PEDVPxxgnnk3l5_syQA-71V1bhUmf0g,1708
|
|
43
|
+
scaler/config/types/zmq.py,sha256=0VODax61H-4PxN6rIeWKlMXOHiW5elVSt1zc-UF0SL8,2593
|
|
44
44
|
scaler/entry_points/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
45
|
scaler/entry_points/cluster.py,sha256=5jPO_fFVe8IiSiAkLhLZ0mXJKXiYUWjvpXjEGlcgwW4,5779
|
|
46
46
|
scaler/entry_points/object_storage_server.py,sha256=SEfBC_MdIHdZUxqHhGPb2AHje5dtIEM5uELRdHfFc0o,1316
|
|
@@ -58,7 +58,7 @@ scaler/io/sync_connector.py,sha256=zRDlBuMVbH92LqbdS35EPHXVOnaeWrvjmZZCISqqjPI,1
|
|
|
58
58
|
scaler/io/sync_object_storage_connector.py,sha256=Zeo0aVAQ_bkRnhmqG9Ozst584072uMQfASfTLixQoeQ,7324
|
|
59
59
|
scaler/io/sync_subscriber.py,sha256=rHbnhkfxvWtyswLNEyvr3D76i-sVBnGwWAGjLp2-thk,2523
|
|
60
60
|
scaler/io/utility.py,sha256=yFq8-X47RfWp344HpRfqc_3XF3c6vewKPLi73e248s8,1189
|
|
61
|
-
scaler/io/ymq/CMakeLists.txt,sha256=
|
|
61
|
+
scaler/io/ymq/CMakeLists.txt,sha256=znJS9ru-tjtn7Lv8RN1RJZVPhlHaE5AKS44z1Nnj_vE,1987
|
|
62
62
|
scaler/io/ymq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
63
|
scaler/io/ymq/_ymq.pyi,sha256=HYLhjYhHTOgjffpAnlqyCSdUjEvKVRP7Slv8vIgGdkI,3036
|
|
64
64
|
scaler/io/ymq/_ymq.so,sha256=XHSDgdogSOfR7P9gPflh6fryTGF-m510BYZXcXj8mNY,1114080
|
|
@@ -66,13 +66,12 @@ scaler/io/ymq/bytes.h,sha256=fxaZ0NMwzJC-agotCZbGizMs-IgPW4VWG4raeWBXC5I,2931
|
|
|
66
66
|
scaler/io/ymq/common.h,sha256=XmYnfVeaIGZU3-gI2slw4uZyRrz807ANJXSQTf1joEY,711
|
|
67
67
|
scaler/io/ymq/configuration.h,sha256=VvtSSGgD5dCOKc-gvtsqSBDoagaRnfnUS7jueDVsn9U,1951
|
|
68
68
|
scaler/io/ymq/epoll_context.cpp,sha256=Sde1QRukul2ecD5EpTu8D-wy3u_tVN-FphvG5QM-3Aw,4937
|
|
69
|
-
scaler/io/ymq/epoll_context.h,sha256=
|
|
69
|
+
scaler/io/ymq/epoll_context.h,sha256=0Cu840Utq6puRHCTVctCWpfdfNpUFcZJqw5D7e7hzSs,2641
|
|
70
70
|
scaler/io/ymq/error.h,sha256=BUb55lcKou20u9e_GHZ0WEmlHJeC3VQWEzW-yTuRCTQ,5552
|
|
71
71
|
scaler/io/ymq/event_loop.h,sha256=CDvcOszqtDSqkFt3t9hsT8n9HStbIchk7UO1u-3CTL0,1652
|
|
72
72
|
scaler/io/ymq/event_loop_thread.cpp,sha256=0aYMmgpg8g6mmC-Ked2F3GCHNGJNXZAZLPobEQqu7g4,1801
|
|
73
73
|
scaler/io/ymq/event_loop_thread.h,sha256=TiB_FZ6s8LE6pIBNeaQv2uuapXkoPG_JRWWywsibKHo,1593
|
|
74
74
|
scaler/io/ymq/event_manager.h,sha256=WTRkNg8j8J_tLNU2ZtilVogC2EoLT5LrLIezeox5i80,2066
|
|
75
|
-
scaler/io/ymq/file_descriptor.h,sha256=trsHS6Xi1vIzBFmYfbyqjT71OQT5y_gopb7OC-0Queo,4948
|
|
76
75
|
scaler/io/ymq/interruptive_concurrent_queue.h,sha256=_hZkdfImpXT0L1fNsb-EfAYbaeTjQNmMGVMyZ6gT2Gg,4750
|
|
77
76
|
scaler/io/ymq/io_context.cpp,sha256=MoIeg3xlSA9Q4S1O4FLXbjJSF7ZV5dRmaKJqUzQl200,3168
|
|
78
77
|
scaler/io/ymq/io_context.h,sha256=eYyXCnHWWfSPVykvvA0sdjjAnKq2y768t3Exg0EU_IA,1248
|
|
@@ -109,7 +108,7 @@ scaler/io/ymq/pymod_ymq/python.h,sha256=wb0-WNF4occ4nDphSoUI47_OrfVPP72eLlGC_B59
|
|
|
109
108
|
scaler/io/ymq/pymod_ymq/ymq.cpp,sha256=LoxL5ViLK0zyWRSYfmZn0QO-0vLw3xVZrRQJ5rWtc4w,526
|
|
110
109
|
scaler/io/ymq/pymod_ymq/ymq.h,sha256=juX5DcDMY8rxp5BixFR0NgSlTrLBPog4JdqyQB9NfVI,11936
|
|
111
110
|
scaler/io/ymq/third_party/concurrentqueue.h,sha256=yN268t8miyojar0bBBPIEjMI3DlHVZci2eufkDDA0FA,152819
|
|
112
|
-
scaler/object_storage/CMakeLists.txt,sha256=
|
|
111
|
+
scaler/object_storage/CMakeLists.txt,sha256=tmkXHBOe1Gho32n4zEqChZBNlxytRTPnIaJ_hAWHBKg,1665
|
|
113
112
|
scaler/object_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
113
|
scaler/object_storage/constants.h,sha256=b5iTCS6lxWjNlanaknIheKJocTofopVxpcRCuMxiDaI,304
|
|
115
114
|
scaler/object_storage/defs.h,sha256=hYFhhYdHgkT6C7iFQuG2d-Rexvkr8VvIy1LLGEh8Mrk,286
|
|
@@ -119,10 +118,10 @@ scaler/object_storage/message.cpp,sha256=nOaLu--Q1UyRLLHZY_8obHtGEhSnPiSnMSbF5uO
|
|
|
119
118
|
scaler/object_storage/message.h,sha256=8KCts7n36jys3PiX09-lPtfa6DjfHI_2hYvled9afG0,4208
|
|
120
119
|
scaler/object_storage/object_manager.cpp,sha256=cxNv9vOkCC910hlF5JF0mOUwTho8ieA1RJgF_P4e3ho,3083
|
|
121
120
|
scaler/object_storage/object_manager.h,sha256=TkxICR8_20I-tkHwnMO0VpLWkm24vOEabrmQG6hdnmQ,1696
|
|
122
|
-
scaler/object_storage/object_storage_server.cpp,sha256=
|
|
123
|
-
scaler/object_storage/object_storage_server.h,sha256=
|
|
124
|
-
scaler/object_storage/object_storage_server.so,sha256=
|
|
125
|
-
scaler/object_storage/pymod_object_storage_server.cpp,sha256=
|
|
121
|
+
scaler/object_storage/object_storage_server.cpp,sha256=lJ863--NU6yzcUJAL4EQ2yQjDBekOaP0dYU581hl_Nc,13635
|
|
122
|
+
scaler/object_storage/object_storage_server.h,sha256=11BD3U9NnLcqx8hFXJCnTjvQEgyirj-0LKlTYgtzaXI,4277
|
|
123
|
+
scaler/object_storage/object_storage_server.so,sha256=jxMfY-9eKU1q4O818TjxExQNpUSOuKlEr8DiH4peqUM,1353249
|
|
124
|
+
scaler/object_storage/pymod_object_storage_server.cpp,sha256=D09p81wZF6WnV35I6od3iDhgktV20v82CRR_tQ90ROs,3811
|
|
126
125
|
scaler/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
127
126
|
scaler/protocol/introduction.md,sha256=G8oRzui4KmSlfFUu70y24tTmDmfEKBkog9tFVUn7G1U,5406
|
|
128
127
|
scaler/protocol/worker.md,sha256=o2Hh_HCooqrptpXcHGzuzUkO_o4NWOurp7ja-DQi5ho,10503
|
|
@@ -223,10 +222,10 @@ scaler/worker_adapter/symphony/message.py,sha256=HOonEASua8e-uwpPVxprjyl1rrYmFJa
|
|
|
223
222
|
scaler/worker_adapter/symphony/task_manager.py,sha256=phgx8dtAv-5ynsvsmG4DKcSlENz4b340FE6LDUWyMwo,12139
|
|
224
223
|
scaler/worker_adapter/symphony/worker.py,sha256=VIDOoqVXbwrjHYN3lghbQpEIuCbVJUgiYsBknrI-0oc,7957
|
|
225
224
|
scaler/worker_adapter/symphony/worker_adapter.py,sha256=eAAD1O0Uz1pjEdQPPl2fd8kyaF6q-aqCRrg48k1ocUU,5455
|
|
226
|
-
opengris_scaler-1.12.
|
|
227
|
-
opengris_scaler-1.12.
|
|
228
|
-
opengris_scaler-1.12.
|
|
229
|
-
opengris_scaler-1.12.
|
|
230
|
-
opengris_scaler-1.12.
|
|
231
|
-
opengris_scaler-1.12.
|
|
232
|
-
opengris_scaler-1.12.
|
|
225
|
+
opengris_scaler-1.12.9.dist-info/METADATA,sha256=Yk5bpbJorqpYauwfQ26S-BG7KHYEexvon0rWodbQrp0,26987
|
|
226
|
+
opengris_scaler-1.12.9.dist-info/WHEEL,sha256=4wppc7XK8XyImqEMe_MI_VzPhF-ahW4R81F5uWo_v_U,118
|
|
227
|
+
opengris_scaler-1.12.9.dist-info/entry_points.txt,sha256=KROw4kj4Z6p8YuOgpOFt5spHskm87A7Z-fOOffT4tVU,446
|
|
228
|
+
opengris_scaler-1.12.9.dist-info/RECORD,,
|
|
229
|
+
opengris_scaler-1.12.9.dist-info/licenses/LICENSE,sha256=xudC0jta6OXJkSHiLzzQQU50HIwSo0G97exO280dtR8,11345
|
|
230
|
+
opengris_scaler-1.12.9.dist-info/licenses/LICENSE.spdx,sha256=i49Qe6AmXxuvocKyExEFduvdh-NQ5YuxdHs515G8VOQ,225
|
|
231
|
+
opengris_scaler-1.12.9.dist-info/licenses/NOTICE,sha256=JUHdG2ssq0nP2QsqPM8X2eJhfJhK_lemIvDBqBRXrMo,286
|
scaler/config/loader.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
import dataclasses
|
|
3
3
|
import enum
|
|
4
|
+
import sys
|
|
4
5
|
from typing import Any, cast, Dict, Optional, Type, TypeVar, Union, get_args, get_origin
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
if sys.version_info >= (3, 11):
|
|
7
8
|
import tomllib
|
|
8
|
-
|
|
9
|
+
else:
|
|
9
10
|
import tomli as tomllib
|
|
10
11
|
|
|
11
12
|
from scaler.config.mixins import ConfigType
|
scaler/config/mixins.py
CHANGED
scaler/config/types/worker.py
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import dataclasses
|
|
2
|
+
import sys
|
|
2
3
|
from typing import List, Dict
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
if sys.version_info >= (3, 11):
|
|
6
|
+
from typing import Self
|
|
7
|
+
else:
|
|
8
|
+
from typing_extensions import Self
|
|
4
9
|
|
|
5
10
|
from scaler.config.mixins import ConfigType
|
|
6
11
|
|
scaler/config/types/zmq.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import dataclasses
|
|
2
2
|
import enum
|
|
3
|
+
import sys
|
|
3
4
|
from typing import Optional
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
if sys.version_info >= (3, 11):
|
|
7
|
+
from typing import Self
|
|
8
|
+
else:
|
|
9
|
+
from typing_extensions import Self
|
|
6
10
|
from scaler.config.mixins import ConfigType
|
|
7
11
|
|
|
8
12
|
|
scaler/io/ymq/CMakeLists.txt
CHANGED
|
@@ -58,7 +58,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/scaler/io/ymq)
|
|
|
58
58
|
|
|
59
59
|
if(LINUX)
|
|
60
60
|
# ymq python =======================================================================================================
|
|
61
|
-
find_package(Python3 COMPONENTS Development.Module REQUIRED)
|
|
62
61
|
|
|
63
62
|
add_library(py_ymq SHARED
|
|
64
63
|
pymod_ymq/bytes.h
|
scaler/io/ymq/epoll_context.h
CHANGED
|
@@ -21,8 +21,6 @@ add_library(object_storage_server_objs OBJECT
|
|
|
21
21
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/scaler/object_storage)
|
|
22
22
|
|
|
23
23
|
# object_storage_server python =========================================================================================
|
|
24
|
-
find_package(Python3 REQUIRED COMPONENTS Development.Module)
|
|
25
|
-
|
|
26
24
|
add_library(py_object_storage_server MODULE
|
|
27
25
|
pymod_object_storage_server.cpp
|
|
28
26
|
)
|
|
@@ -29,7 +29,8 @@ void ObjectStorageServer::run(
|
|
|
29
29
|
ObjectStorageServer::Identity identity,
|
|
30
30
|
std::string log_level,
|
|
31
31
|
std::string log_format,
|
|
32
|
-
std::vector<std::string> log_paths
|
|
32
|
+
std::vector<std::string> log_paths,
|
|
33
|
+
std::function<bool()> running)
|
|
33
34
|
{
|
|
34
35
|
_logger = scaler::ymq::Logger(log_format, std::move(log_paths), scaler::ymq::Logger::stringToLogLevel(log_level));
|
|
35
36
|
|
|
@@ -44,7 +45,7 @@ void ObjectStorageServer::run(
|
|
|
44
45
|
|
|
45
46
|
_logger.log(scaler::ymq::Logger::LoggingLevel::info, "ObjectStorageServer: started");
|
|
46
47
|
|
|
47
|
-
processRequests();
|
|
48
|
+
processRequests(running);
|
|
48
49
|
|
|
49
50
|
_ioContext.removeIOSocket(_ioSocket);
|
|
50
51
|
} catch (const std::exception& e) {
|
|
@@ -117,7 +118,7 @@ void ObjectStorageServer::closeServerReadyFds()
|
|
|
117
118
|
}
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
void ObjectStorageServer::processRequests()
|
|
121
|
+
void ObjectStorageServer::processRequests(std::function<bool()> running)
|
|
121
122
|
{
|
|
122
123
|
using namespace std::chrono_literals;
|
|
123
124
|
Identity lastMessageIdentity;
|
|
@@ -134,7 +135,13 @@ void ObjectStorageServer::processRequests()
|
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
137
|
|
|
137
|
-
auto
|
|
138
|
+
auto maybeMessageFuture = ymq::futureRecvMessage(_ioSocket);
|
|
139
|
+
while (maybeMessageFuture.wait_for(100ms) == std::future_status::timeout) {
|
|
140
|
+
if (!running()) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
auto maybeMessage = maybeMessageFuture.get();
|
|
138
145
|
|
|
139
146
|
if (!maybeMessage) {
|
|
140
147
|
auto error = maybeMessage.error();
|
|
@@ -35,7 +35,8 @@ public:
|
|
|
35
35
|
Identity identity = "ObjectStorageServer",
|
|
36
36
|
std::string log_level = "INFO",
|
|
37
37
|
std::string log_format = "%(levelname)s: %(message)s",
|
|
38
|
-
std::vector<std::string> log_paths = {"/dev/stdout"}
|
|
38
|
+
std::vector<std::string> log_paths = {"/dev/stdout"},
|
|
39
|
+
std::function<bool()> running = []() { return true; });
|
|
39
40
|
|
|
40
41
|
void waitUntilReady();
|
|
41
42
|
|
|
@@ -78,7 +79,7 @@ private:
|
|
|
78
79
|
|
|
79
80
|
void closeServerReadyFds();
|
|
80
81
|
|
|
81
|
-
void processRequests();
|
|
82
|
+
void processRequests(std::function<bool()> stopCondition);
|
|
82
83
|
|
|
83
84
|
void processSetRequest(std::shared_ptr<Client> client, std::pair<ObjectRequestHeader, Bytes> request);
|
|
84
85
|
|
|
Binary file
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#define PY_SSIZE_T_CLEAN
|
|
2
2
|
#include <Python.h>
|
|
3
|
+
#include <pyerrors.h>
|
|
3
4
|
|
|
5
|
+
#include "scaler/io/ymq/pymod_ymq/gil.h"
|
|
4
6
|
#include "scaler/object_storage/object_storage_server.h"
|
|
5
7
|
|
|
6
8
|
extern "C" {
|
|
@@ -52,10 +54,19 @@ static PyObject* PyObjectStorageServerRun(PyObject* self, PyObject* args)
|
|
|
52
54
|
logging_paths.push_back(PyUnicode_AsUTF8(path_obj));
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
auto running = []() -> bool {
|
|
58
|
+
AcquireGIL gil;
|
|
59
|
+
(void)gil;
|
|
60
|
+
return PyErr_CheckSignals() == 0;
|
|
61
|
+
};
|
|
62
|
+
|
|
55
63
|
((PyObjectStorageServer*)self)
|
|
56
|
-
->server.run(
|
|
64
|
+
->server.run(
|
|
65
|
+
addr, std::to_string(port), identity, log_level, log_format, std::move(logging_paths), std::move(running));
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
// TODO: Ideally, run should return a bool and we return failure with nullptr.
|
|
68
|
+
return nullptr;
|
|
69
|
+
// Py_RETURN_NONE;
|
|
59
70
|
}
|
|
60
71
|
|
|
61
72
|
static PyObject* PyObjectStorageServerWaitUntilReady(PyObject* self, [[maybe_unused]] PyObject* args)
|
scaler/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.12.
|
|
1
|
+
1.12.9
|
scaler/io/ymq/file_descriptor.h
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
#pragma once
|
|
2
|
-
|
|
3
|
-
// System
|
|
4
|
-
#include <sys/epoll.h>
|
|
5
|
-
#include <sys/eventfd.h>
|
|
6
|
-
#include <sys/socket.h>
|
|
7
|
-
#include <sys/timerfd.h>
|
|
8
|
-
#include <unistd.h>
|
|
9
|
-
|
|
10
|
-
// C
|
|
11
|
-
#include <cerrno>
|
|
12
|
-
|
|
13
|
-
// C++
|
|
14
|
-
#include <expected>
|
|
15
|
-
#include <optional>
|
|
16
|
-
|
|
17
|
-
// First-party
|
|
18
|
-
#include "scaler/io/ymq/common.h"
|
|
19
|
-
|
|
20
|
-
class FileDescriptor {
|
|
21
|
-
int fd;
|
|
22
|
-
|
|
23
|
-
FileDescriptor(int fd): fd(fd) {}
|
|
24
|
-
|
|
25
|
-
public:
|
|
26
|
-
~FileDescriptor() noexcept(false)
|
|
27
|
-
{
|
|
28
|
-
if (auto code = close(fd) < 0)
|
|
29
|
-
throw std::system_error(errno, std::system_category(), "Failed to close file descriptor");
|
|
30
|
-
|
|
31
|
-
this->fd = -1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
FileDescriptor(): fd(-1) {}
|
|
35
|
-
|
|
36
|
-
// move-only
|
|
37
|
-
FileDescriptor(const FileDescriptor&) = delete;
|
|
38
|
-
FileDescriptor& operator=(const FileDescriptor&) = delete;
|
|
39
|
-
FileDescriptor(FileDescriptor&& other) noexcept: fd(other.fd)
|
|
40
|
-
{
|
|
41
|
-
other.fd = -1; // prevent double close
|
|
42
|
-
}
|
|
43
|
-
FileDescriptor& operator=(FileDescriptor&& other) noexcept
|
|
44
|
-
{
|
|
45
|
-
if (this != &other) {
|
|
46
|
-
if (fd >= 0) {
|
|
47
|
-
close(fd); // close current fd
|
|
48
|
-
}
|
|
49
|
-
fd = other.fd;
|
|
50
|
-
other.fd = -1; // prevent double close
|
|
51
|
-
}
|
|
52
|
-
return *this;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
static std::expected<FileDescriptor, Errno> socket(int domain, int type, int protocol)
|
|
56
|
-
{
|
|
57
|
-
if (int fd = ::socket(domain, type, protocol) < 0) {
|
|
58
|
-
return std::unexpected {errno};
|
|
59
|
-
} else {
|
|
60
|
-
return FileDescriptor(fd);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
static std::expected<FileDescriptor, Errno> eventfd(int initval, int flags)
|
|
65
|
-
{
|
|
66
|
-
if (int fd = ::eventfd(initval, flags) < 0) {
|
|
67
|
-
return std::unexpected {errno};
|
|
68
|
-
} else {
|
|
69
|
-
return FileDescriptor(fd);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
static std::expected<FileDescriptor, Errno> timerfd(clockid_t clock, int flags)
|
|
74
|
-
{
|
|
75
|
-
if (int fd = ::timerfd_create(clock, flags) < 0) {
|
|
76
|
-
return std::unexpected {errno};
|
|
77
|
-
} else {
|
|
78
|
-
return FileDescriptor(fd);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static std::expected<FileDescriptor, Errno> epollfd()
|
|
83
|
-
{
|
|
84
|
-
if (int fd = ::epoll_create1(0) < 0) {
|
|
85
|
-
return std::unexpected {errno};
|
|
86
|
-
} else {
|
|
87
|
-
return FileDescriptor(fd);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
std::optional<Errno> listen(int backlog)
|
|
92
|
-
{
|
|
93
|
-
if (::listen(fd, backlog) < 0) {
|
|
94
|
-
return errno;
|
|
95
|
-
} else {
|
|
96
|
-
return std::nullopt;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
std::expected<FileDescriptor, Errno> accept(sockaddr& addr, socklen_t& addrlen)
|
|
101
|
-
{
|
|
102
|
-
if (auto fd2 = ::accept(fd, &addr, &addrlen) < 0) {
|
|
103
|
-
return std::unexpected {errno};
|
|
104
|
-
} else {
|
|
105
|
-
return FileDescriptor(fd2);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
std::optional<Errno> connect(const sockaddr& addr, socklen_t addrlen)
|
|
110
|
-
{
|
|
111
|
-
if (::connect(fd, &addr, addrlen) < 0) {
|
|
112
|
-
return errno;
|
|
113
|
-
} else {
|
|
114
|
-
return std::nullopt;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
std::optional<Errno> bind(const sockaddr& addr, socklen_t addrlen)
|
|
119
|
-
{
|
|
120
|
-
if (::bind(fd, &addr, addrlen) < 0) {
|
|
121
|
-
return errno;
|
|
122
|
-
} else {
|
|
123
|
-
return std::nullopt;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
std::expected<ssize_t, Errno> read(void* buf, size_t count)
|
|
128
|
-
{
|
|
129
|
-
ssize_t n = ::read(fd, buf, count);
|
|
130
|
-
if (n < 0) {
|
|
131
|
-
return std::unexpected {errno};
|
|
132
|
-
} else {
|
|
133
|
-
return n;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
std::expected<ssize_t, Errno> write(const void* buf, size_t count)
|
|
138
|
-
{
|
|
139
|
-
ssize_t n = ::write(fd, buf, count);
|
|
140
|
-
if (n < 0) {
|
|
141
|
-
return std::unexpected {errno};
|
|
142
|
-
} else {
|
|
143
|
-
return n;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
std::optional<Errno> eventfd_signal()
|
|
148
|
-
{
|
|
149
|
-
uint64_t u = 1;
|
|
150
|
-
if (::eventfd_write(fd, u) < 0) {
|
|
151
|
-
return errno;
|
|
152
|
-
} else {
|
|
153
|
-
return std::nullopt;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
std::optional<Errno> eventfd_wait()
|
|
158
|
-
{
|
|
159
|
-
uint64_t u;
|
|
160
|
-
if (::eventfd_read(fd, &u) < 0) {
|
|
161
|
-
return errno;
|
|
162
|
-
} else {
|
|
163
|
-
return std::nullopt;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
std::optional<Errno> timerfd_settime(const itimerspec& new_value, itimerspec* old_value = nullptr)
|
|
168
|
-
{
|
|
169
|
-
if (::timerfd_settime(fd, 0, &new_value, old_value) < 0) {
|
|
170
|
-
return errno;
|
|
171
|
-
} else {
|
|
172
|
-
return std::nullopt;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
std::optional<Errno> timerfd_wait()
|
|
177
|
-
{
|
|
178
|
-
uint64_t u;
|
|
179
|
-
if (::read(fd, &u, sizeof(u)) < 0) {
|
|
180
|
-
return errno;
|
|
181
|
-
} else {
|
|
182
|
-
return std::nullopt;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
std::optional<Errno> epoll_ctl(int op, FileDescriptor& other, epoll_event* event)
|
|
187
|
-
{
|
|
188
|
-
if (::epoll_ctl(fd, op, other.fd, event) < 0) {
|
|
189
|
-
return errno;
|
|
190
|
-
} else {
|
|
191
|
-
return std::nullopt;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
std::expected<int, Errno> epoll_wait(epoll_event* events, int maxevents, int timeout)
|
|
196
|
-
{
|
|
197
|
-
if (auto n = ::epoll_wait(fd, events, maxevents, timeout) < 0) {
|
|
198
|
-
return errno;
|
|
199
|
-
} else {
|
|
200
|
-
return n;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|