Skip to content

Commit 7ec820e

Browse files
committed
Address Copilot feedback (6)
Signed-off-by: Sergio Herrera <627709+seherv@users.noreply.github.com>
1 parent e8c4c05 commit 7ec820e

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/internal/shared.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ def is_async_callable(fn: Any) -> bool:
2929
candidate = fn
3030
while isinstance(candidate, functools.partial):
3131
candidate = candidate.func
32-
candidate = inspect.unwrap(candidate) if callable(candidate) else candidate
32+
if callable(candidate):
33+
try:
34+
candidate = inspect.unwrap(candidate)
35+
except ValueError:
36+
# Cyclic ``__wrapped__`` chain from a malformed decorator. Fall back to the
37+
# outermost callable; misclassification is preferable to crashing dispatch.
38+
pass
3339
if inspect.iscoroutinefunction(candidate):
3440
return True
3541
if not inspect.isfunction(candidate) and hasattr(candidate, '__call__'):

ext/dapr-ext-workflow/dapr/ext/workflow/_durabletask/worker.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,8 +1143,11 @@ async def _execute_activity_async(
11431143
instance_id,
11441144
)
11451145
except RuntimeError as exc:
1146-
# Manager thread pool shut down (worker is tearing down). Treat as transient:
1147-
# the sidecar will re-dispatch the work item once the worker reconnects.
1146+
# Only swallow if the manager thread pool was shut down (worker is tearing
1147+
# down). The sidecar will re-dispatch the work item once the worker reconnects.
1148+
# Other RuntimeErrors are unexpected and bubble up to the work-item processor.
1149+
if not self._async_worker_manager._shutdown:
1150+
raise
11481151
self._logger.warning(
11491152
f"Could not deliver activity response for '{req.name}#{req.taskId}': "
11501153
f'{exc}. The sidecar will re-dispatch this work item.'

ext/dapr-ext-workflow/docs/concurrency.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ hosts or need per-call timeout isolation, stick with per-call clients.
7070
## Re-running the benchmark
7171

7272
```bash
73+
uv sync --all-packages --group dev
7374
uv run python ext/dapr-ext-workflow/benchmarks/bench_async_activities.py
7475
```
7576

76-
Override the 120 s sustained run with `DAPR_BENCH_SUSTAINED_SECONDS=30` for a
77-
faster local check. Set `DAPR_BENCH_WITH_SIDECAR=1` to exercise the end-to-end
78-
path against a real sidecar. The script creates `benchmarks/RESULTS.md`.
77+
Override the 120 s sustained run with `DAPR_BENCH_SUSTAINED_SECONDS=30`
78+
for a faster local check. Set `DAPR_BENCH_WITH_SIDECAR=1` to exercise the
79+
end-to-end path against a real sidecar. The script creates `benchmarks/RESULTS.md`.

0 commit comments

Comments
 (0)