Commit 1806084
fix(observe): Handle asyncio.CancelledError in exception blocks (#1566)
Fixes langfuse/langfuse#12650
This catches and records the async task being cancelled—either directly or
because it timed out—which will raise an asyncio.CancelledError to stop
execution.
Also fix sync wrappers as well. Note that asyncio.CancelledError can cross
async-sync boundaries, such as `run_coroutine_threadsafe().result()` or a sync
helper function that re-raises cancellation that was previously
suppressed/deferred.
Co-authored-by: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com>1 parent 51e0b7f commit 1806084
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
656 | | - | |
| 656 | + | |
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
| |||
0 commit comments