Commit 5071aab
committed
fix(sse): Handle ClosedResourceError during shutdown
Improved the fix for the cancel scope lifecycle violation by adding
graceful handling of ClosedResourceError. When streams close during
shutdown, the error handler may attempt to send exceptions to already
closed streams, which should be ignored as this is expected behavior.
This maintains the original fix (removing manual tg.cancel_scope.cancel())
while handling the race condition it exposed in error cleanup.1 parent 49ee0f9 commit 5071aab
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
142 | 146 | | |
143 | 147 | | |
144 | 148 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| |||
0 commit comments