Commit 959db0b
[python] BUG-3 fix — silence shutdown race noise in serve()
Cancel gossip/heartbeat tasks BEFORE server.shutdown() so the background
coroutines stop scheduling futures onto the event loop during interpreter
teardown. Add loop.is_closed() guard + RuntimeError handler in _task() so
in-flight handler threads return 503 instead of logging "cannot schedule
new futures after interpreter shutdown".
Closes BUG-3 from #357 E2E bug tracker.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b898883 commit 959db0b
1 file changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
696 | 701 | | |
697 | 702 | | |
698 | 703 | | |
| |||
709 | 714 | | |
710 | 715 | | |
711 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
712 | 723 | | |
713 | 724 | | |
714 | 725 | | |
| |||
744 | 755 | | |
745 | 756 | | |
746 | 757 | | |
747 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
748 | 762 | | |
749 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
750 | 767 | | |
751 | 768 | | |
752 | 769 | | |
| |||
0 commit comments