opengris-scaler 1.12.12__cp38-cp38-musllinux_1_2_x86_64.whl → 1.12.13__cp38-cp38-musllinux_1_2_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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: opengris-scaler
3
- Version: 1.12.12
3
+ Version: 1.12.13
4
4
  Summary: OpenGRIS Scaler Distribution Framework
5
5
  Author-Email: Citi <opensource@citi.com>
6
6
  License: Apache 2.0
@@ -25,7 +25,7 @@ Provides-Extra: uvloop
25
25
  Requires-Dist: uvloop; platform_system != "Windows" and extra == "uvloop"
26
26
  Provides-Extra: gui
27
27
  Requires-Dist: nicegui[plotly]==2.24.2; python_version == "3.8" and extra == "gui"
28
- Requires-Dist: nicegui[plotly]==3.0.3; python_version >= "3.9" and extra == "gui"
28
+ Requires-Dist: nicegui[plotly]==3.0.4; python_version >= "3.9" and extra == "gui"
29
29
  Provides-Extra: graphblas
30
30
  Requires-Dist: python-graphblas; extra == "graphblas"
31
31
  Requires-Dist: numpy==1.24.4; python_version == "3.8" and extra == "graphblas"
@@ -33,7 +33,7 @@ Requires-Dist: numpy==2.0.2; python_version == "3.9" and extra == "graphblas"
33
33
  Requires-Dist: numpy==2.2.6; python_version >= "3.10" and extra == "graphblas"
34
34
  Provides-Extra: all
35
35
  Requires-Dist: nicegui[plotly]==2.24.2; python_version == "3.8" and extra == "all"
36
- Requires-Dist: nicegui[plotly]==3.0.3; python_version >= "3.9" and extra == "all"
36
+ Requires-Dist: nicegui[plotly]==3.0.4; python_version >= "3.9" and extra == "all"
37
37
  Requires-Dist: python-graphblas; extra == "all"
38
38
  Requires-Dist: numpy==1.24.4; python_version == "3.8" and extra == "all"
39
39
  Requires-Dist: numpy==2.0.2; python_version == "3.9" and extra == "all"
@@ -5,7 +5,7 @@ opengris_scaler.libs/libstdc++-08d5c7eb.so.6.0.33,sha256=k0S_imrCh_IE6WpvxrLoVPY
5
5
  scaler/CMakeLists.txt,sha256=60rkhpiwy0F-DSsRX_6nRrjYQvQ1Jp9mGp8fZsi006k,305
6
6
  scaler/__init__.py,sha256=nZU5QZ9oW2YIaGwm3-r-6dfmirTVzZpDPDNtX-ITCV4,513
7
7
  scaler/about.py,sha256=OBcfSvHO0P3mWaa2Ci4WEOTbH7is-3uYymScxgZPxyg,161
8
- scaler/version.txt,sha256=_ybmMM5LatOmnnmjaCb5UGsJOUUCujnikVGbB3D0Atg,8
8
+ scaler/version.txt,sha256=F6PMSyppBgeF1s1ced3yCqk9L1U1rOtqGWHlqvHibuU,8
9
9
  scaler/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  scaler/client/client.py,sha256=9WWclvdsouYPREGwmkWWA3gpz5DVFEAD6HKbtXr3Jx8,25506
11
11
  scaler/client/future.py,sha256=fOl5g4Is4E5jtvO0kmRk4uUs_eUjSjMmyniYhWMAH4w,10041
@@ -46,7 +46,7 @@ scaler/config/types/zmq.py,sha256=0VODax61H-4PxN6rIeWKlMXOHiW5elVSt1zc-UF0SL8,25
46
46
  scaler/entry_points/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  scaler/entry_points/cluster.py,sha256=5jPO_fFVe8IiSiAkLhLZ0mXJKXiYUWjvpXjEGlcgwW4,5779
48
48
  scaler/entry_points/object_storage_server.py,sha256=YGDl9-ws0oha1YXXl3gFH660B-IV2o06gCp41zUovdg,1418
49
- scaler/entry_points/scheduler.py,sha256=w4Ps1PJX0dnu13xwnnuQFMppkW5Se7cIrcXuJlaWfTA,6025
49
+ scaler/entry_points/scheduler.py,sha256=uJkmr1M3gzTEWmntdDr0f0-zls2V91vRPANahRjFj0c,6003
50
50
  scaler/entry_points/top.py,sha256=pqOPD27HeZrnMvqw4cOF4bvZ-sxgg7zp_Q1v8VtbC4A,9542
51
51
  scaler/entry_points/webui.py,sha256=ypcrE6Lr4rUX_qM0qSsv-dX7kzZiMMWTe5GL-Ol45BI,1067
52
52
  scaler/entry_points/worker_adapter_native.py,sha256=1If3xEu2YsnRIrAmcP-MXmnVTF7hescDed4jTL3vkzM,5412
@@ -63,29 +63,29 @@ scaler/io/utility.py,sha256=yFq8-X47RfWp344HpRfqc_3XF3c6vewKPLi73e248s8,1189
63
63
  scaler/io/ymq/CMakeLists.txt,sha256=znJS9ru-tjtn7Lv8RN1RJZVPhlHaE5AKS44z1Nnj_vE,1987
64
64
  scaler/io/ymq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
65
65
  scaler/io/ymq/_ymq.pyi,sha256=HYLhjYhHTOgjffpAnlqyCSdUjEvKVRP7Slv8vIgGdkI,3036
66
- scaler/io/ymq/_ymq.so,sha256=D9qAin8_34iHION8fCtVKVH-4eRHjSjBJ4lwzy5bhJg,674001
66
+ scaler/io/ymq/_ymq.so,sha256=EMNbhCSUj5wLwYJHlZjLFHmGLBzdpRLUSFBXIlf4j1Y,665809
67
67
  scaler/io/ymq/bytes.h,sha256=fxaZ0NMwzJC-agotCZbGizMs-IgPW4VWG4raeWBXC5I,2931
68
68
  scaler/io/ymq/common.h,sha256=XmYnfVeaIGZU3-gI2slw4uZyRrz807ANJXSQTf1joEY,711
69
69
  scaler/io/ymq/configuration.h,sha256=VvtSSGgD5dCOKc-gvtsqSBDoagaRnfnUS7jueDVsn9U,1951
70
- scaler/io/ymq/epoll_context.cpp,sha256=Sde1QRukul2ecD5EpTu8D-wy3u_tVN-FphvG5QM-3Aw,4937
70
+ scaler/io/ymq/epoll_context.cpp,sha256=BE-Ol2p8-t61BajaEzLK-B2ABNNDiExVbb0Ym9BjbVA,4938
71
71
  scaler/io/ymq/epoll_context.h,sha256=0Cu840Utq6puRHCTVctCWpfdfNpUFcZJqw5D7e7hzSs,2641
72
72
  scaler/io/ymq/error.h,sha256=BUb55lcKou20u9e_GHZ0WEmlHJeC3VQWEzW-yTuRCTQ,5552
73
73
  scaler/io/ymq/event_loop.h,sha256=CDvcOszqtDSqkFt3t9hsT8n9HStbIchk7UO1u-3CTL0,1652
74
74
  scaler/io/ymq/event_loop_thread.cpp,sha256=0aYMmgpg8g6mmC-Ked2F3GCHNGJNXZAZLPobEQqu7g4,1801
75
- scaler/io/ymq/event_loop_thread.h,sha256=TiB_FZ6s8LE6pIBNeaQv2uuapXkoPG_JRWWywsibKHo,1593
75
+ scaler/io/ymq/event_loop_thread.h,sha256=XNsVDH7r4tDBlU4VstrwMBGgOMOEsoDn7qLFjox1nEg,1683
76
76
  scaler/io/ymq/event_manager.h,sha256=WTRkNg8j8J_tLNU2ZtilVogC2EoLT5LrLIezeox5i80,2066
77
77
  scaler/io/ymq/interruptive_concurrent_queue.h,sha256=_hZkdfImpXT0L1fNsb-EfAYbaeTjQNmMGVMyZ6gT2Gg,4750
78
- scaler/io/ymq/io_context.cpp,sha256=MoIeg3xlSA9Q4S1O4FLXbjJSF7ZV5dRmaKJqUzQl200,3168
78
+ scaler/io/ymq/io_context.cpp,sha256=nVjZCYE8zeYkWScDeYsXEh8AW9qhyORodn7etaT3-Vs,3080
79
79
  scaler/io/ymq/io_context.h,sha256=eYyXCnHWWfSPVykvvA0sdjjAnKq2y768t3Exg0EU_IA,1248
80
- scaler/io/ymq/io_socket.cpp,sha256=8fj8KjS_I7U8zwOLQasX7rDy8gkquTs9G-Vc1UXMmZE,11584
80
+ scaler/io/ymq/io_socket.cpp,sha256=Li6P-7R80YwduaL59_D2wQ36twufdIIXaP7IS46zSwQ,11506
81
81
  scaler/io/ymq/io_socket.h,sha256=lWqfJHZg6OGxz16x2NwKKbtvjfErrC4IUP3puw72Nwg,4953
82
82
  scaler/io/ymq/iocp_context.cpp,sha256=SRGEn5MVoWl8JUIO2sZDUQi6AbhrXfhQ-aRoWiaF2SY,3103
83
83
  scaler/io/ymq/iocp_context.h,sha256=pAwrs8XZWHIskEdQyA5BrISxsiSzfW6r9J873pBMs4Q,2731
84
84
  scaler/io/ymq/logging.h,sha256=TJFeawseU8zkWiSC_yS3dO2i0oKAWAZFzyb_vk0tU7Q,5421
85
85
  scaler/io/ymq/message.h,sha256=yBAd5BIeDttWqseyoUBPKPnD1qT05o_vlqEN3J53lP4,241
86
86
  scaler/io/ymq/message_connection.h,sha256=dvkIjMt31gPFephJURtxcqm7TFAWZ3y0ZvuekXFL3_Q,350
87
- scaler/io/ymq/message_connection_tcp.cpp,sha256=_iwRfCxajpEWHfBPtendYRpeZE-OyjW05_OztZKXLxk,21779
88
- scaler/io/ymq/message_connection_tcp.h,sha256=rxLF6MaCnkQW4Zke_5LvD180IC-9l65yyBiA4xwORJU,2728
87
+ scaler/io/ymq/message_connection_tcp.cpp,sha256=yxIFZBzShzAEUUtHXhSj6sy_udRC-Jw-TwvZk3Vio6Q,21902
88
+ scaler/io/ymq/message_connection_tcp.h,sha256=C7jo2fVeHqdhIk8cAaVNAnnF8IyIIJT0EZC1Sf_MDe4,2743
89
89
  scaler/io/ymq/network_utils.h,sha256=qebEdeKYpztZLI02c25eqcRmFMqBZN3GEaE81fiyBF8,4142
90
90
  scaler/io/ymq/readme.md,sha256=gzjJJovTVjV0e-4QpjrscT0gmtDiPjszAIlVt5upshg,3739
91
91
  scaler/io/ymq/simple_interface.cpp,sha256=BpsjGW3xGCajnQDa9UN8GJA_Xu15LfJTU4IRnsGOA04,2912
@@ -103,12 +103,12 @@ scaler/io/ymq/ymq.py,sha256=d8bxU0h2maQvIkiJgGeTD-QynCOa4JwYCwuVfxqq9AE,4658
103
103
  scaler/io/ymq/pymod_ymq/bytes.h,sha256=srlYnWibw2a9mgulzCc5H-7TnMob8QWA2ChAdbZ4bxw,3135
104
104
  scaler/io/ymq/pymod_ymq/exception.h,sha256=4nfUpc8VJDRZeBvgmOZN_j0FHmryZTbxzzBrWQKhhG4,3573
105
105
  scaler/io/ymq/pymod_ymq/gil.h,sha256=YdFOBWEBC1TSYmIvzr5NDZf-xmm49PMGqYP2nh-5Fk8,403
106
- scaler/io/ymq/pymod_ymq/io_context.h,sha256=HZs3rTDLW5tVHhH_a5crXLvnozZB9eHioxJ5xH87cVU,5005
107
- scaler/io/ymq/pymod_ymq/io_socket.h,sha256=Y5Tzt_T4z-Kiinb9zzJj-2ovG0OUs6aKwZ8AH5RdSTk,9415
106
+ scaler/io/ymq/pymod_ymq/io_context.h,sha256=03DcUlHCZyk78rNJmxRFgjxFOiQLWCq5FLm-gEENi0k,5014
107
+ scaler/io/ymq/pymod_ymq/io_socket.h,sha256=1M7NhhyP3alEJ9fnS04cwY9Frz4b5gZ19qPCCGxSeLQ,9674
108
108
  scaler/io/ymq/pymod_ymq/message.h,sha256=gqYKDnNCK9W1q0gte0pGfbmx119gQvcWBaJzIFdRsuc,3039
109
109
  scaler/io/ymq/pymod_ymq/python.h,sha256=wb0-WNF4occ4nDphSoUI47_OrfVPP72eLlGC_B59b7c,4284
110
110
  scaler/io/ymq/pymod_ymq/ymq.cpp,sha256=LoxL5ViLK0zyWRSYfmZn0QO-0vLw3xVZrRQJ5rWtc4w,526
111
- scaler/io/ymq/pymod_ymq/ymq.h,sha256=juX5DcDMY8rxp5BixFR0NgSlTrLBPog4JdqyQB9NfVI,11936
111
+ scaler/io/ymq/pymod_ymq/ymq.h,sha256=p3cNnvgv8R1ThCBM56G-OlINWZsm1Xd0o14kpItG9gw,11892
112
112
  scaler/io/ymq/third_party/concurrentqueue.h,sha256=yN268t8miyojar0bBBPIEjMI3DlHVZci2eufkDDA0FA,152819
113
113
  scaler/object_storage/CMakeLists.txt,sha256=qexi6sKNGieaRhKkO65kxdaQrKRY-8adYKlvc42aEew,1566
114
114
  scaler/object_storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -121,8 +121,8 @@ scaler/object_storage/message.h,sha256=8KCts7n36jys3PiX09-lPtfa6DjfHI_2hYvled9af
121
121
  scaler/object_storage/object_manager.cpp,sha256=cxNv9vOkCC910hlF5JF0mOUwTho8ieA1RJgF_P4e3ho,3083
122
122
  scaler/object_storage/object_manager.h,sha256=TkxICR8_20I-tkHwnMO0VpLWkm24vOEabrmQG6hdnmQ,1696
123
123
  scaler/object_storage/object_storage_server.cpp,sha256=ZiMpLOakguD3p108OVRf0XQmsZtHN5tw5Fs46Pq0nwA,13794
124
- scaler/object_storage/object_storage_server.h,sha256=11BD3U9NnLcqx8hFXJCnTjvQEgyirj-0LKlTYgtzaXI,4277
125
- scaler/object_storage/object_storage_server.so,sha256=qYEwP_QL-lKyFuiF1dOcJE3vWTOK4hAXV18nHt4rzWI,766289
124
+ scaler/object_storage/object_storage_server.h,sha256=X8W4QFHgNUmBOsJ-JfADfMu9Z4pti8OFYyMR3C1Am1Q,4244
125
+ scaler/object_storage/object_storage_server.so,sha256=Z32-SdK-n25jE3LkbTAFMTluVEH_wtsqbPG4D-KjbUI,762193
126
126
  scaler/object_storage/pymod_object_storage_server.cpp,sha256=D09p81wZF6WnV35I6od3iDhgktV20v82CRR_tQ90ROs,3811
127
127
  scaler/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
128
  scaler/protocol/introduction.md,sha256=G8oRzui4KmSlfFUu70y24tTmDmfEKBkog9tFVUn7G1U,5406
@@ -224,10 +224,10 @@ scaler/worker_adapter/symphony/message.py,sha256=HOonEASua8e-uwpPVxprjyl1rrYmFJa
224
224
  scaler/worker_adapter/symphony/task_manager.py,sha256=phgx8dtAv-5ynsvsmG4DKcSlENz4b340FE6LDUWyMwo,12139
225
225
  scaler/worker_adapter/symphony/worker.py,sha256=VIDOoqVXbwrjHYN3lghbQpEIuCbVJUgiYsBknrI-0oc,7957
226
226
  scaler/worker_adapter/symphony/worker_adapter.py,sha256=eAAD1O0Uz1pjEdQPPl2fd8kyaF6q-aqCRrg48k1ocUU,5455
227
- opengris_scaler-1.12.12.dist-info/METADATA,sha256=It2hi9UNQsgtbh--T9GMMiPlwYH2CnWCXEYrcY_uEV4,27234
228
- opengris_scaler-1.12.12.dist-info/WHEEL,sha256=XKO4RLwor0g5skDMe1ttji76FU-p6-_UPlAU3nSO9s0,115
229
- opengris_scaler-1.12.12.dist-info/entry_points.txt,sha256=KROw4kj4Z6p8YuOgpOFt5spHskm87A7Z-fOOffT4tVU,446
230
- opengris_scaler-1.12.12.dist-info/RECORD,,
231
- opengris_scaler-1.12.12.dist-info/licenses/LICENSE,sha256=xudC0jta6OXJkSHiLzzQQU50HIwSo0G97exO280dtR8,11345
232
- opengris_scaler-1.12.12.dist-info/licenses/LICENSE.spdx,sha256=i49Qe6AmXxuvocKyExEFduvdh-NQ5YuxdHs515G8VOQ,225
233
- opengris_scaler-1.12.12.dist-info/licenses/NOTICE,sha256=JUHdG2ssq0nP2QsqPM8X2eJhfJhK_lemIvDBqBRXrMo,286
227
+ opengris_scaler-1.12.13.dist-info/METADATA,sha256=ETTF9ysLYGYoViBW74q-0f5eprUiesTpR2y7hl0ijwk,27234
228
+ opengris_scaler-1.12.13.dist-info/WHEEL,sha256=XKO4RLwor0g5skDMe1ttji76FU-p6-_UPlAU3nSO9s0,115
229
+ opengris_scaler-1.12.13.dist-info/entry_points.txt,sha256=KROw4kj4Z6p8YuOgpOFt5spHskm87A7Z-fOOffT4tVU,446
230
+ opengris_scaler-1.12.13.dist-info/RECORD,,
231
+ opengris_scaler-1.12.13.dist-info/licenses/LICENSE,sha256=xudC0jta6OXJkSHiLzzQQU50HIwSo0G97exO280dtR8,11345
232
+ opengris_scaler-1.12.13.dist-info/licenses/LICENSE.spdx,sha256=i49Qe6AmXxuvocKyExEFduvdh-NQ5YuxdHs515G8VOQ,225
233
+ opengris_scaler-1.12.13.dist-info/licenses/NOTICE,sha256=JUHdG2ssq0nP2QsqPM8X2eJhfJhK_lemIvDBqBRXrMo,286
@@ -93,7 +93,10 @@ def main():
93
93
 
94
94
  scheduler_config = load_config(SchedulerConfig, args.config, args, section_name="scheduler")
95
95
 
96
- if args.object_storage_address is None:
96
+ object_storage_address = scheduler_config.object_storage_address
97
+ object_storage = None
98
+
99
+ if object_storage_address is None:
97
100
  object_storage_address = ObjectStorageConfig(
98
101
  host=scheduler_config.scheduler_address.host, port=get_available_tcp_port()
99
102
  )
@@ -105,9 +108,6 @@ def main():
105
108
  )
106
109
  object_storage.start()
107
110
  object_storage.wait_until_ready() # object storage should be ready before starting the cluster
108
- else:
109
- object_storage_address = scheduler_config.object_storage_address
110
- object_storage = None
111
111
 
112
112
  scheduler = SchedulerProcess(
113
113
  address=scheduler_config.scheduler_address,
scaler/io/ymq/_ymq.so CHANGED
Binary file
@@ -41,7 +41,7 @@ void EpollContext::loop()
41
41
  // todo: investigate better error handling
42
42
  // the epoll thread is not expected to receive signals(?)
43
43
  // but occasionally does (e.g. sigwinch) and we shouldn't stop the thread in that case
44
- break;
44
+ return;
45
45
  case EBADF:
46
46
  case EFAULT:
47
47
  case EINVAL:
@@ -38,6 +38,12 @@ public:
38
38
  EventLoopThread& operator=(const EventLoopThread&) = delete;
39
39
  EventLoopThread() = default;
40
40
 
41
+ void tryJoin()
42
+ {
43
+ if (thread.joinable())
44
+ thread.join();
45
+ }
46
+
41
47
  private:
42
48
  std::jthread thread;
43
49
  };
@@ -76,15 +76,14 @@ void IOContext::removeIOSocket(std::shared_ptr<IOSocket>& socket) noexcept
76
76
  }
77
77
  }
78
78
  if (id != -1) {
79
- assert(_threads[id].use_count() == 1);
79
+ _threads[id]->tryJoin();
80
80
  _threads[id] = std::make_shared<EventLoopThread>();
81
81
  }
82
82
  }
83
83
 
84
84
  void IOContext::requestIOSocketStop(std::shared_ptr<IOSocket> socket) noexcept
85
85
  {
86
- socket->_eventLoopThread->_eventLoop.executeNow(
87
- [socket] { socket->_eventLoopThread->_eventLoop.executeLater([socket] { socket->requestStop(); }); });
86
+ socket->_eventLoopThread->_eventLoop.executeNow([socket] { socket->requestStop(); });
88
87
  }
89
88
 
90
89
  IOContext::~IOContext() noexcept
@@ -145,14 +145,11 @@ void IOSocket::bindTo(std::string networkAddress, BindReturnCallback onBindRetur
145
145
  void IOSocket::closeConnection(Identity remoteSocketIdentity) noexcept
146
146
  {
147
147
  _eventLoopThread->_eventLoop.executeNow([this, remoteIdentity = std::move(remoteSocketIdentity)] {
148
- _eventLoopThread->_eventLoop.executeLater([this, remoteIdentity = std::move(remoteIdentity)] {
149
- if (_stopped) {
150
- return;
151
- }
152
- // _identityToConnection.erase(remoteIdentity);
153
- if (_identityToConnection.contains(remoteIdentity))
154
- _identityToConnection[remoteIdentity]->disconnect();
155
- });
148
+ if (_stopped) {
149
+ return;
150
+ }
151
+ if (_identityToConnection.contains(remoteIdentity))
152
+ _identityToConnection[remoteIdentity]->disconnect();
156
153
  });
157
154
  }
158
155
 
@@ -179,6 +176,7 @@ void IOSocket::onConnectionDisconnected(MessageConnectionTCP* conn, bool keepInB
179
176
  this->_pendingRecvMessages->pop();
180
177
  }
181
178
  }
179
+ _eventLoopThread->_eventLoop.executeLater([conn = std::move(connPtr)]() {});
182
180
  _unestablishedConnection.pop_back();
183
181
  return;
184
182
  }
@@ -244,6 +242,7 @@ void IOSocket::onConnectionIdentityReceived(MessageConnectionTCP* conn) noexcept
244
242
  assert(targetConn->_receivedReadOperations.empty());
245
243
  targetConn->_receivedReadOperations = std::move((*c)->_receivedReadOperations);
246
244
 
245
+ assert((*c)->_connFd == 0);
247
246
  _unestablishedConnection.erase(c);
248
247
  }
249
248
 
@@ -321,6 +321,9 @@ void MessageConnectionTCP::onRead()
321
321
  return _remoteIOSocketIdentity;
322
322
  })
323
323
  .and_then([this, maybeCloseConn](const std::string&) -> std::optional<std::string> {
324
+ if (!_connFd) {
325
+ return _remoteIOSocketIdentity;
326
+ }
324
327
  auto _ = tryReadMessages()
325
328
  .or_else(maybeCloseConn) //
326
329
  .and_then([this]() -> std::expected<void, IOError> {
@@ -62,8 +62,9 @@ private:
62
62
  void onClose();
63
63
  void onError()
64
64
  {
65
- onRead();
66
- // onClose();
65
+ if (_connFd) {
66
+ onRead();
67
+ }
67
68
  };
68
69
 
69
70
  std::expected<void, IOError> tryReadOneMessage();
@@ -105,20 +105,21 @@ static PyObject* PyIOContext_createIOSocket(PyIOContext* self, PyObject* args, P
105
105
  if (!ioSocket)
106
106
  return nullptr;
107
107
 
108
- Py_INCREF(callback);
109
-
110
108
  try {
111
109
  // ensure the fields are init
112
110
  new (&ioSocket->socket) std::shared_ptr<IOSocket>();
113
111
  new (&ioSocket->ioContext) std::shared_ptr<IOContext>();
114
112
  ioSocket->ioContext = self->ioContext;
115
113
 
114
+ Py_INCREF(callback);
115
+
116
116
  self->ioContext->createIOSocket(
117
117
  std::string(identity, identityLen), socketType, [callback, ioSocket](auto socket) {
118
118
  AcquireGIL _;
119
119
 
120
- ioSocket->socket = socket;
121
- OwnedPyObject _result = PyObject_CallFunctionObjArgs(callback, *ioSocket, nullptr);
120
+ ioSocket->socket = socket;
121
+ OwnedPyObject _result = PyObject_CallFunctionObjArgs(callback, *ioSocket, nullptr);
122
+
122
123
  Py_DECREF(callback);
123
124
  });
124
125
  } catch (...) {
@@ -57,8 +57,8 @@ static PyObject* PyIOSocket_send(PyIOSocket* self, PyObject* args, PyObject* kwa
57
57
  if (!state)
58
58
  return nullptr;
59
59
 
60
- PyObject* callback = nullptr;
61
- PyMessage* message = nullptr;
60
+ PyObject* callback = nullptr;
61
+ PyMessage* message = nullptr;
62
62
 
63
63
  // empty str -> positional only
64
64
  const char* kwlist[] = {"", "message", nullptr};
@@ -73,9 +73,9 @@ static PyObject* PyIOSocket_send(PyIOSocket* self, PyObject* args, PyObject* kwa
73
73
  auto address = message->address.is_none() ? Bytes() : std::move(message->address->bytes);
74
74
  auto payload = std::move(message->payload->bytes);
75
75
 
76
- Py_INCREF(callback);
77
-
78
76
  try {
77
+ Py_INCREF(callback);
78
+
79
79
  self->socket->sendMessage(
80
80
  {.address = std::move(address), .payload = std::move(payload)}, [callback, state](auto result) {
81
81
  AcquireGIL _;
@@ -108,35 +108,45 @@ static PyObject* PyIOSocket_recv(PyIOSocket* self, PyObject* args, PyObject* kwa
108
108
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", (char**)kwlist, &callback))
109
109
  return nullptr;
110
110
 
111
- Py_INCREF(callback);
112
-
113
111
  try {
112
+ Py_INCREF(callback);
113
+
114
114
  self->socket->recvMessage([callback, state](std::pair<Message, Error> result) {
115
115
  AcquireGIL _;
116
116
 
117
117
  if (result.second._errorCode != Error::ErrorCode::Uninit) {
118
118
  OwnedPyObject obj = YMQException_createFromCoreError(state, &result.second);
119
119
  OwnedPyObject _ = PyObject_CallFunctionObjArgs(callback, *obj, nullptr);
120
+ Py_DECREF(callback);
120
121
  return;
121
122
  }
122
123
 
123
124
  auto message = result.first;
124
125
  OwnedPyObject<PyBytesYMQ> address = (PyBytesYMQ*)PyObject_CallNoArgs(*state->PyBytesYMQType);
125
- if (!address)
126
- return completeCallbackWithRaisedException(callback);
126
+ if (!address) {
127
+ completeCallbackWithRaisedException(callback);
128
+ Py_DECREF(callback);
129
+ return;
130
+ }
127
131
 
128
132
  address->bytes = std::move(message.address);
129
133
 
130
134
  OwnedPyObject<PyBytesYMQ> payload = (PyBytesYMQ*)PyObject_CallNoArgs(*state->PyBytesYMQType);
131
- if (!payload)
132
- return completeCallbackWithRaisedException(callback);
135
+ if (!payload) {
136
+ completeCallbackWithRaisedException(callback);
137
+ Py_DECREF(callback);
138
+ return;
139
+ }
133
140
 
134
141
  payload->bytes = std::move(message.payload);
135
142
 
136
143
  OwnedPyObject<PyMessage> pyMessage =
137
144
  (PyMessage*)PyObject_CallFunction(*state->PyMessageType, "OO", *address, *payload);
138
- if (!pyMessage)
139
- return completeCallbackWithRaisedException(callback);
145
+ if (!pyMessage) {
146
+ completeCallbackWithRaisedException(callback);
147
+ Py_DECREF(callback);
148
+ return;
149
+ }
140
150
 
141
151
  OwnedPyObject _result = PyObject_CallFunctionObjArgs(callback, *pyMessage, nullptr);
142
152
  Py_DECREF(callback);
@@ -162,9 +172,9 @@ static PyObject* PyIOSocket_bind(PyIOSocket* self, PyObject* args, PyObject* kwa
162
172
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os#", (char**)kwlist, &callback, &address, &addressLen))
163
173
  return nullptr;
164
174
 
165
- Py_INCREF(callback);
166
-
167
175
  try {
176
+ Py_INCREF(callback);
177
+
168
178
  self->socket->bindTo(std::string(address, addressLen), [callback, state](auto result) {
169
179
  AcquireGIL _;
170
180
 
@@ -198,9 +208,9 @@ static PyObject* PyIOSocket_connect(PyIOSocket* self, PyObject* args, PyObject*
198
208
  if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os#", (char**)kwlist, &callback, &address, &addressLen))
199
209
  return nullptr;
200
210
 
201
- Py_INCREF(callback);
202
-
203
211
  try {
212
+ Py_INCREF(callback);
213
+
204
214
  self->socket->connectTo(std::string(address, addressLen), [callback, state](auto result) {
205
215
  AcquireGIL _;
206
216
 
@@ -20,13 +20,13 @@ struct YMQState {
20
20
  OwnedPyObject<> enumModule; // Reference to the enum module
21
21
  OwnedPyObject<> asyncioModule; // Reference to the asyncio module
22
22
 
23
- OwnedPyObject<> PyIOSocketEnumType; // Reference to the IOSocketType enum
24
- OwnedPyObject<> PyErrorCodeType; // Reference to the Error enum
25
- OwnedPyObject<> PyBytesYMQType; // Reference to the PyBytesYMQ type
26
- OwnedPyObject<> PyMessageType; // Reference to the Message type
27
- OwnedPyObject<> PyIOSocketType; // Reference to the IOSocket type
28
- OwnedPyObject<> PyIOContextType; // Reference to the IOContext type
29
- OwnedPyObject<> PyExceptionType; // Reference to the Exception type
23
+ OwnedPyObject<> PyIOSocketEnumType; // Reference to the IOSocketType enum
24
+ OwnedPyObject<> PyErrorCodeType; // Reference to the Error enum
25
+ OwnedPyObject<> PyBytesYMQType; // Reference to the PyBytesYMQ type
26
+ OwnedPyObject<> PyMessageType; // Reference to the Message type
27
+ OwnedPyObject<> PyIOSocketType; // Reference to the IOSocket type
28
+ OwnedPyObject<> PyIOContextType; // Reference to the IOContext type
29
+ OwnedPyObject<> PyExceptionType; // Reference to the Exception type
30
30
  };
31
31
 
32
32
  static YMQState* YMQStateFromSelf(PyObject* self)
@@ -76,8 +76,8 @@ std::expected<PyObject*, PyObject*> YMQ_GetRaisedException()
76
76
 
77
77
  void completeCallbackWithRaisedException(PyObject* callback)
78
78
  {
79
- auto result = YMQ_GetRaisedException();
80
- OwnedPyObject _ =PyObject_CallFunctionObjArgs(callback, result.value_or(result.error()));
79
+ auto result = YMQ_GetRaisedException();
80
+ OwnedPyObject _ = PyObject_CallFunctionObjArgs(callback, result.value_or(result.error()), nullptr);
81
81
  }
82
82
 
83
83
  // First-Party
@@ -69,8 +69,6 @@ private:
69
69
 
70
70
  scaler::ymq::Logger _logger;
71
71
 
72
- std::atomic<bool> _stopped;
73
-
74
72
  std::vector<SendMessageFuture> _pendingSendMessageFuts;
75
73
 
76
74
  void initServerReadyFds();
scaler/version.txt CHANGED
@@ -1 +1 @@
1
- 1.12.12
1
+ 1.12.13