xoscar 0.4.4__cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.4.5__cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.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.

@@ -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
- # write buffers
84
- write_buffers(self.writer, buffers)
85
- async with self._send_lock:
86
- # add lock, or when parallel send,
87
- # assertion error may be raised
88
- await self.writer.drain()
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,12 +196,14 @@ 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
- self.cancel_tasks()
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
@@ -232,14 +234,11 @@ def _cancel_all_tasks(loop):
232
234
 
233
235
 
234
236
  def _safe_run_forever(loop):
235
- loop.run_forever()
236
- _cancel_all_tasks(loop)
237
-
238
-
239
- def _safe_exit_thread(loop, thread):
240
- # To avoid _enter_buffered_busy: could not acquire lock
241
- loop.call_soon_threadsafe(loop.stop)
242
- thread.join()
237
+ try:
238
+ loop.run_forever()
239
+ finally:
240
+ _cancel_all_tasks(loop)
241
+ loop.stop()
243
242
 
244
243
 
245
244
  class ActorCaller:
@@ -253,7 +252,7 @@ class ActorCaller:
253
252
  target=_safe_run_forever, args=(_close_loop,), daemon=True
254
253
  )
255
254
  _close_thread.start()
256
- atexit.register(_safe_exit_thread, _close_loop, _close_thread)
255
+ atexit.register(_close_loop.call_soon_threadsafe, _close_loop.stop)
257
256
 
258
257
  def __init__(self):
259
258
  self._thread_local = threading.local()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xoscar
3
- Version: 0.4.4
3
+ Version: 0.4.5
4
4
  Summary: Python actor framework for heterogeneous computing.
5
5
  Home-page: http://github.com/xorbitsai/xoscar
6
6
  Author: Qin Xuye
@@ -1,3 +1,7 @@
1
+ xoscar-0.4.5.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
2
+ xoscar-0.4.5.dist-info/RECORD,,
3
+ xoscar-0.4.5.dist-info/METADATA,sha256=VBE6NGqxBQ98kZBu6a7orT-YY5EExPhmLhuWKxATIdw,9042
4
+ xoscar-0.4.5.dist-info/WHEEL,sha256=sLizzaCm5RO_U5e_F5zOShQNJ3TeuZ7GEwyo10nwIfE,153
1
5
  xoscar/errors.py,sha256=wBlQOKsXf0Fc4skN39tDie0YZT-VIAuLNRgoDl2pZcA,1241
2
6
  xoscar/nvutils.py,sha256=qmW4mKLU0WB2yCs198ccQOgLL02zB7Fsa-AotO3NOmg,20412
3
7
  xoscar/utils.py,sha256=jUw6OICZUPBbmS1b3GE4vLctJf6fCKXrYtLtBuK-Oqc,16483
@@ -38,7 +42,7 @@ xoscar/metrics/backends/console/__init__.py,sha256=h_JgzSqV5lP6vQ6XX_17kE4IY4BRn
38
42
  xoscar/backends/message.cpython-312-aarch64-linux-gnu.so,sha256=PKUmScWty4eTytL1G8YV2F54xTpeiBqTtkpwY75bHz0,3488072
39
43
  xoscar/backends/context.py,sha256=Vr_PibRxYCDQ_gYK7r-BOlw9TXw8VQbFsVTH7K7mHPk,15470
40
44
  xoscar/backends/__init__.py,sha256=VHEBQcUWM5bj027W8EUf9PiJUAP7JoMrRw3Tsvy5ySw,643
41
- xoscar/backends/core.py,sha256=3hWgmVYddSy341wsinYOr0yFSlICC9SBr-KQ_KeJRLw,10262
45
+ xoscar/backends/core.py,sha256=rXJ73IC5lgERXCWvVrDEEyGAILlwVJs7XIWBCFUEVCc,10166
42
46
  xoscar/backends/allocate_strategy.py,sha256=tC1Nbq2tJohahUwd-zoRYHEDX65wyuX8tmeY45uWj_w,4845
43
47
  xoscar/backends/pool.py,sha256=Z7Wdab9dBF3SdQpmzgZhY0d09oTvg5gpFgzYH7vuc4w,59841
44
48
  xoscar/backends/router.py,sha256=mhSvM5KVfV882jricVcpyxAqHEvhS4zL6ivczC6fOTE,7746
@@ -48,13 +52,13 @@ xoscar/backends/message.pyi,sha256=__2piPWLUQBmkDzx_nsHMOC2wHG53IKVGU_47zwgdKM,6
48
52
  xoscar/backends/test/__init__.py,sha256=j2ZfD6prD9WjUxRUDC7Eq5Z7N7TkL6fFr59oNyc_vY4,682
49
53
  xoscar/backends/test/pool.py,sha256=TW4X6J-92Pti66103poQBNDBznX6CBD3RLOc_zixjTo,7257
50
54
  xoscar/backends/test/backend.py,sha256=nv9WFhH5Bbq4Q1HB9yfpciZBaeHT4IQAtzugBWESrUY,1263
51
- xoscar/backends/communication/dummy.py,sha256=sKBqoFkftm6ynV3p5UNGI4VYFGlrOHJgJlqj35PGAgk,8479
55
+ xoscar/backends/communication/dummy.py,sha256=6kLkxjNk4xTQ-IlNZD6cftNCx5UsGOur2jk7ikrNUCg,8157
52
56
  xoscar/backends/communication/errors.py,sha256=V3CdBe2xX9Rwv32f2dH2Msc84yaUhlyerZ42-739o1Q,723
53
57
  xoscar/backends/communication/utils.py,sha256=AmovE-hmWLXNCPwHafYuaRjOk8m42BUyT3XBqfXQRVI,3664
54
58
  xoscar/backends/communication/__init__.py,sha256=tB05BlK63iWQnfJgRzKt4mFKRtmWUki5hUGSZQwAotc,1050
55
59
  xoscar/backends/communication/core.py,sha256=sJeE3foRIqVPXldzYpFKHDSsabfAIFBU4JuXY4OyklY,2130
56
60
  xoscar/backends/communication/base.py,sha256=0P4Tr35GSWpRp394e9jVWUUoKKa-gIk177eYPw1BnSU,7421
57
- xoscar/backends/communication/socket.py,sha256=R9jF_Iy3HTSPXkBGrws5ckK-EjYnaPBSTdMqMZYqxqc,13972
61
+ xoscar/backends/communication/socket.py,sha256=_1tuBZrSmdEC6c6QIj_7JQh23ruIIQPwySDMcrndzwA,14267
58
62
  xoscar/backends/communication/ucx.py,sha256=_Dp9Ld2MWIa1txSGMnmfYwJDT0esxS-GOd2FQ4BdHiM,19960
59
63
  xoscar/backends/indigen/driver.py,sha256=VGzkacYKykegW5qhCuhx01gdgBZEKJjNIyfNCnA6Nm8,952
60
64
  xoscar/backends/indigen/__init__.py,sha256=tKHP5ClzedBRBpZsLRVErR3EUNbbDm4CY4u0rCFJr44,685
@@ -76,7 +80,3 @@ xoscar/serialization/numpy.py,sha256=5Kem87CvpJmzUMp3QHk4WeHU30FoQWTJJP2SwIcaQG0
76
80
  xoscar/serialization/pyfury.py,sha256=sifOnVMYoS82PzZEkzkfxesmMHei23k5UAUUKUyoOYQ,1163
77
81
  xoscar/serialization/core.cpython-312-aarch64-linux-gnu.so,sha256=7troSFzh2ajnwlFW504vukrKU0XLxJzcAdDMYav6EN0,3369360
78
82
  xoscar/serialization/cuda.py,sha256=iFUEnN4SiquBIhyieyOrfw3TnKnW-tU_vYgqOxO_DrA,3758
79
- xoscar-0.4.4.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
80
- xoscar-0.4.4.dist-info/RECORD,,
81
- xoscar-0.4.4.dist-info/METADATA,sha256=8sNSbbwMLWNK_U4dPToYPbX3J3epO77vL9ivudhzOBY,9042
82
- xoscar-0.4.4.dist-info/WHEEL,sha256=sLizzaCm5RO_U5e_F5zOShQNJ3TeuZ7GEwyo10nwIfE,153
File without changes