xoscar 0.4.3__cp311-cp311-macosx_10_9_x86_64.whl → 0.4.5__cp311-cp311-macosx_10_9_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 xoscar might be problematic. Click here for more details.
- xoscar/_utils.cpython-311-darwin.so +0 -0
- xoscar/backends/communication/dummy.py +0 -7
- xoscar/backends/communication/socket.py +14 -6
- xoscar/backends/core.py +38 -3
- xoscar/backends/message.cpython-311-darwin.so +0 -0
- xoscar/context.cpython-311-darwin.so +0 -0
- xoscar/core.cpython-311-darwin.so +0 -0
- xoscar/serialization/core.cpython-311-darwin.so +0 -0
- {xoscar-0.4.3.dist-info → xoscar-0.4.5.dist-info}/METADATA +1 -1
- {xoscar-0.4.3.dist-info → xoscar-0.4.5.dist-info}/RECORD +12 -12
- {xoscar-0.4.3.dist-info → xoscar-0.4.5.dist-info}/WHEEL +0 -0
- {xoscar-0.4.3.dist-info → xoscar-0.4.5.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
@@ -249,12 +249,5 @@ class DummyClient(Client):
|
|
|
249
249
|
async def close(self):
|
|
250
250
|
await super().close()
|
|
251
251
|
if self._task is not None:
|
|
252
|
-
task_loop = self._task.get_loop()
|
|
253
|
-
if task_loop is not None:
|
|
254
|
-
if not task_loop.is_running():
|
|
255
|
-
logger.warning(
|
|
256
|
-
"Dummy channel cancel task on a stopped loop, dest address: %s.",
|
|
257
|
-
self.dest_address,
|
|
258
|
-
)
|
|
259
252
|
self._task.cancel()
|
|
260
253
|
self._task = None
|
|
@@ -34,6 +34,7 @@ from ...serialization import AioDeserializer, AioSerializer, deserialize
|
|
|
34
34
|
from ...utils import classproperty, implements, is_py_312, is_v6_ip
|
|
35
35
|
from .base import Channel, ChannelType, Client, Server
|
|
36
36
|
from .core import register_client, register_server
|
|
37
|
+
from .errors import ChannelClosed
|
|
37
38
|
from .utils import read_buffers, write_buffers
|
|
38
39
|
|
|
39
40
|
_is_windows: bool = sys.platform.startswith("win")
|
|
@@ -80,12 +81,19 @@ class SocketChannel(Channel):
|
|
|
80
81
|
serializer = AioSerializer(message, compress=compress)
|
|
81
82
|
buffers = await serializer.run()
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
try:
|
|
85
|
+
# write buffers
|
|
86
|
+
write_buffers(self.writer, buffers)
|
|
87
|
+
async with self._send_lock:
|
|
88
|
+
# add lock, or when parallel send,
|
|
89
|
+
# assertion error may be raised
|
|
90
|
+
await self.writer.drain()
|
|
91
|
+
except RuntimeError as e:
|
|
92
|
+
if self.writer.is_closing():
|
|
93
|
+
raise ChannelClosed(
|
|
94
|
+
"Channel already closed, cannot write message"
|
|
95
|
+
) from e
|
|
96
|
+
raise e
|
|
89
97
|
|
|
90
98
|
@implements(Channel.recv)
|
|
91
99
|
async def recv(self):
|
xoscar/backends/core.py
CHANGED
|
@@ -196,18 +196,51 @@ class ActorCallerThreadLocal:
|
|
|
196
196
|
return await self.call_with_client(client, message, wait)
|
|
197
197
|
|
|
198
198
|
async def stop(self):
|
|
199
|
-
logger.debug("Actor caller stop.")
|
|
200
199
|
try:
|
|
201
200
|
await asyncio.gather(*[client.close() for client in self._clients])
|
|
202
201
|
except (ConnectionError, ServerClosed):
|
|
203
202
|
pass
|
|
204
|
-
|
|
203
|
+
try:
|
|
204
|
+
self.cancel_tasks()
|
|
205
|
+
except:
|
|
206
|
+
pass
|
|
205
207
|
|
|
206
208
|
def cancel_tasks(self):
|
|
207
209
|
# cancel listening for all clients
|
|
208
210
|
_ = [task.cancel() for task in self._clients.values()]
|
|
209
211
|
|
|
210
212
|
|
|
213
|
+
def _cancel_all_tasks(loop):
|
|
214
|
+
to_cancel = asyncio.all_tasks(loop)
|
|
215
|
+
if not to_cancel:
|
|
216
|
+
return
|
|
217
|
+
|
|
218
|
+
for task in to_cancel:
|
|
219
|
+
task.cancel()
|
|
220
|
+
|
|
221
|
+
loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
|
|
222
|
+
|
|
223
|
+
for task in to_cancel:
|
|
224
|
+
if task.cancelled():
|
|
225
|
+
continue
|
|
226
|
+
if task.exception() is not None:
|
|
227
|
+
loop.call_exception_handler(
|
|
228
|
+
{
|
|
229
|
+
"message": "unhandled exception during asyncio.run() shutdown",
|
|
230
|
+
"exception": task.exception(),
|
|
231
|
+
"task": task,
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
def _safe_run_forever(loop):
|
|
237
|
+
try:
|
|
238
|
+
loop.run_forever()
|
|
239
|
+
finally:
|
|
240
|
+
_cancel_all_tasks(loop)
|
|
241
|
+
loop.stop()
|
|
242
|
+
|
|
243
|
+
|
|
211
244
|
class ActorCaller:
|
|
212
245
|
__slots__ = "_thread_local"
|
|
213
246
|
|
|
@@ -215,7 +248,9 @@ class ActorCaller:
|
|
|
215
248
|
pass
|
|
216
249
|
|
|
217
250
|
_close_loop = asyncio.new_event_loop()
|
|
218
|
-
_close_thread = threading.Thread(
|
|
251
|
+
_close_thread = threading.Thread(
|
|
252
|
+
target=_safe_run_forever, args=(_close_loop,), daemon=True
|
|
253
|
+
)
|
|
219
254
|
_close_thread.start()
|
|
220
255
|
atexit.register(_close_loop.call_soon_threadsafe, _close_loop.stop)
|
|
221
256
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
xoscar-0.4.
|
|
2
|
-
xoscar-0.4.
|
|
3
|
-
xoscar-0.4.
|
|
4
|
-
xoscar-0.4.
|
|
1
|
+
xoscar-0.4.5.dist-info/RECORD,,
|
|
2
|
+
xoscar-0.4.5.dist-info/WHEEL,sha256=k313prM1litdYY0m9CIWjnJcoMut0fJadB3MrPSqgmk,111
|
|
3
|
+
xoscar-0.4.5.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
|
|
4
|
+
xoscar-0.4.5.dist-info/METADATA,sha256=R6Zr_mb9l4xkf5mOtPo6XBDzFlR_XjHbq-oOrmdc3uM,9042
|
|
5
5
|
xoscar/_utils.pyx,sha256=UR1FtYXAYKIdEWR9HulEpMbSOrkQWi6xGz63d4IQmG0,7059
|
|
6
|
-
xoscar/_utils.cpython-311-darwin.so,sha256=
|
|
6
|
+
xoscar/_utils.cpython-311-darwin.so,sha256=egihMehAHT2WUKFfs7owKuVKOsQRIwI4291kTyFAP1M,160440
|
|
7
7
|
xoscar/backend.py,sha256=is436OPkZfSpQXaoqTRVta5eoye_pp45RFgCstAk2hU,1850
|
|
8
8
|
xoscar/core.pxd,sha256=4lBq8J0kjcXcsGuvN7Kv4xcL5liHwTTFWlqyK7XAEnw,1280
|
|
9
9
|
xoscar/_version.py,sha256=ClSPrUjgGRGHIkVMQV9XQnkQ-n0akJMnq_rh819nqFE,23719
|
|
@@ -14,11 +14,11 @@ xoscar/constants.py,sha256=QHHSREw6uWBBjQDCFqlNfTvBZgniJPGy42KSIsR8Fqw,787
|
|
|
14
14
|
xoscar/__init__.py,sha256=0zX8kKaio3ZIrlzB79WybcravMJw1OxPWjDspTgJFyQ,1608
|
|
15
15
|
xoscar/api.py,sha256=3hztPoOxg8A_mlhWyWgVP7FMXG0PATA1TP4Rbaj7A-g,13327
|
|
16
16
|
xoscar/utils.py,sha256=jUw6OICZUPBbmS1b3GE4vLctJf6fCKXrYtLtBuK-Oqc,16483
|
|
17
|
-
xoscar/context.cpython-311-darwin.so,sha256=
|
|
17
|
+
xoscar/context.cpython-311-darwin.so,sha256=WT6sieAeD4W_BL2mKJRwfQF9GgRKtc8kEGnk-F78uWI,200528
|
|
18
18
|
xoscar/debug.py,sha256=9Z8SgE2WaKYQcyDo-5-DxEJQ533v7kWjrvCd28pSx3E,5069
|
|
19
19
|
xoscar/libcpp.pxd,sha256=DJqBxLFOKL4iRr9Kale5UH3rbvPRD1x5bTSOPHFpz9I,1147
|
|
20
20
|
xoscar/context.pyx,sha256=8CdgPnWcE9eOp3N600WgDQ03MCi8P73eUOGcfV7Zksg,10942
|
|
21
|
-
xoscar/core.cpython-311-darwin.so,sha256=
|
|
21
|
+
xoscar/core.cpython-311-darwin.so,sha256=JnlJHSNcrL2qnyLZWdgKL7hqVAH_rSLWN22igRhrgjY,448248
|
|
22
22
|
xoscar/errors.py,sha256=wBlQOKsXf0Fc4skN39tDie0YZT-VIAuLNRgoDl2pZcA,1241
|
|
23
23
|
xoscar/core.pyx,sha256=Aqc2i8Fetsd5wRAPF4kL0ddnBZn3E2HRNCvup79BbQc,21730
|
|
24
24
|
xoscar/driver.py,sha256=498fowtJr6b3FE8FIOA_Tc1Vwx88nfZw7p0FxrML0h4,1372
|
|
@@ -46,13 +46,13 @@ xoscar/serialization/numpy.py,sha256=5Kem87CvpJmzUMp3QHk4WeHU30FoQWTJJP2SwIcaQG0
|
|
|
46
46
|
xoscar/serialization/cuda.py,sha256=iFUEnN4SiquBIhyieyOrfw3TnKnW-tU_vYgqOxO_DrA,3758
|
|
47
47
|
xoscar/serialization/scipy.py,sha256=yOEi0NB8cqQ6e2UnCZ1w006RsB7T725tIL-DM_hNcsU,2482
|
|
48
48
|
xoscar/serialization/aio.py,sha256=5DySPgDxU43ec7_5Ct44-Oqt7YNSJBfuf8VdQgQlChA,4731
|
|
49
|
-
xoscar/serialization/core.cpython-311-darwin.so,sha256=
|
|
49
|
+
xoscar/serialization/core.cpython-311-darwin.so,sha256=gstYdSH6mJ6HA-Y2roxjFN0-ordMyqWmmhg-Gg6jzcI,408048
|
|
50
50
|
xoscar/serialization/core.pyx,sha256=bjR-zXGm9qersk7kYPzpjpMIxDl_Auur4BCubRfKmfA,29626
|
|
51
|
-
xoscar/backends/message.cpython-311-darwin.so,sha256=
|
|
51
|
+
xoscar/backends/message.cpython-311-darwin.so,sha256=M9Ihpyns09h_-Y1XxvErVLcbnCI4Lp557jkmtuFGuAU,366672
|
|
52
52
|
xoscar/backends/config.py,sha256=EG26f0GwX_f4dAhwTW77RBjiK9h8R_3JrD-rBF1bAq8,4984
|
|
53
53
|
xoscar/backends/allocate_strategy.py,sha256=tC1Nbq2tJohahUwd-zoRYHEDX65wyuX8tmeY45uWj_w,4845
|
|
54
54
|
xoscar/backends/__init__.py,sha256=VHEBQcUWM5bj027W8EUf9PiJUAP7JoMrRw3Tsvy5ySw,643
|
|
55
|
-
xoscar/backends/core.py,sha256=
|
|
55
|
+
xoscar/backends/core.py,sha256=rXJ73IC5lgERXCWvVrDEEyGAILlwVJs7XIWBCFUEVCc,10166
|
|
56
56
|
xoscar/backends/context.py,sha256=Vr_PibRxYCDQ_gYK7r-BOlw9TXw8VQbFsVTH7K7mHPk,15470
|
|
57
57
|
xoscar/backends/router.py,sha256=mhSvM5KVfV882jricVcpyxAqHEvhS4zL6ivczC6fOTE,7746
|
|
58
58
|
xoscar/backends/message.pyx,sha256=uyzilPc_7SqNwGUL4U-Zbfqku8bfZyRW_Lt_S3I_LEU,17930
|
|
@@ -69,8 +69,8 @@ xoscar/backends/communication/__init__.py,sha256=tB05BlK63iWQnfJgRzKt4mFKRtmWUki
|
|
|
69
69
|
xoscar/backends/communication/core.py,sha256=sJeE3foRIqVPXldzYpFKHDSsabfAIFBU4JuXY4OyklY,2130
|
|
70
70
|
xoscar/backends/communication/utils.py,sha256=AmovE-hmWLXNCPwHafYuaRjOk8m42BUyT3XBqfXQRVI,3664
|
|
71
71
|
xoscar/backends/communication/errors.py,sha256=V3CdBe2xX9Rwv32f2dH2Msc84yaUhlyerZ42-739o1Q,723
|
|
72
|
-
xoscar/backends/communication/socket.py,sha256=
|
|
73
|
-
xoscar/backends/communication/dummy.py,sha256=
|
|
72
|
+
xoscar/backends/communication/socket.py,sha256=_1tuBZrSmdEC6c6QIj_7JQh23ruIIQPwySDMcrndzwA,14267
|
|
73
|
+
xoscar/backends/communication/dummy.py,sha256=6kLkxjNk4xTQ-IlNZD6cftNCx5UsGOur2jk7ikrNUCg,8157
|
|
74
74
|
xoscar/backends/communication/base.py,sha256=0P4Tr35GSWpRp394e9jVWUUoKKa-gIk177eYPw1BnSU,7421
|
|
75
75
|
xoscar/aio/__init__.py,sha256=kViDKR_kJe59VQViHITKEfBcIgN4ZJblUyd8zl0E3ZI,675
|
|
76
76
|
xoscar/aio/file.py,sha256=PBtkLp-Q7XtYl-zk00s18TtgIrkNr60J3Itf66ctO1o,1486
|
|
File without changes
|
|
File without changes
|