Skip to content

Commit 647b6d8

Browse files
committed
CI debug testing
1 parent 18264f2 commit 647b6d8

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

temporalio/bridge/src/worker.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ pub struct TunerHolder {
6464
local_activity_slot_supplier: SlotSupplier,
6565
}
6666

67+
// pub fn set_task_locals_on_tuner<'a>(py: Python<'a>, tuner: &TunerHolder) -> PyResult<()> {
68+
// // TODO: All suppliers
69+
// if let SlotSupplier::Custom(ref cs) = tuner.workflow_slot_supplier {
70+
// Python::with_gil(|py| {
71+
// let py_obj = cs.inner.as_ref(py);
72+
// py_obj.call_method0("set_task_locals")?;
73+
// Ok(())
74+
// })?;
75+
// };
76+
// Ok(())
77+
// }
78+
6779
#[derive(FromPyObject)]
6880
pub enum SlotSupplier {
6981
FixedSize(FixedSizeSlotSupplier),
@@ -217,6 +229,7 @@ impl<SK: SlotKind + Send + Sync> SlotSupplierTrait for CustomSlotSupplierOfType<
217229
.await;
218230
match pypermit {
219231
Ok(p) => {
232+
dbg!("reserve done", SK::kind());
220233
return SlotSupplierPermit::with_user_data(p);
221234
}
222235
Err(_) => {
@@ -274,6 +287,7 @@ impl<SK: SlotKind + Send + Sync> SlotSupplierTrait for CustomSlotSupplierOfType<
274287
}
275288

276289
fn release_slot(&self, ctx: &dyn SlotReleaseContext<SlotKind = Self::SlotKind>) {
290+
dbg!("release", SK::kind());
277291
if let Err(e) = Python::with_gil(|py| {
278292
let permit = ctx
279293
.permit()
@@ -362,6 +376,8 @@ pub fn new_replay_worker<'a>(
362376
impl WorkerRef {
363377
fn validate<'p>(&self, py: Python<'p>) -> PyResult<&'p PyAny> {
364378
let worker = self.worker.as_ref().unwrap().clone();
379+
// Set custom slot supplier task locals so they can run futures
380+
// match worker.get_config().tuner {}
365381
self.runtime.future_into_py(py, async move {
366382
worker
367383
.validate()

tests/worker/test_worker.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,6 @@ def reserve_asserts(self, ctx):
422422
await wf1.signal(WaitOnSignalWorkflow.my_signal, "finish")
423423
await wf1.result()
424424

425-
async def releases() -> int:
426-
return ss.releases
427-
428425
assert ss.reserves == ss.releases
429426
# Two workflow tasks, one activity
430427
assert ss.used == 3

0 commit comments

Comments
 (0)