Commit 307bbfd
committed
fix: detect shutdown and break DurableTaskGrpcWorker loop
The worker loop ran `while (true)` and only exited if an
InterruptedException happened during the 5-second retry sleep.
If `close()` was called while the gRPC stream was blocking, the
CANCELLED exception was logged but the loop kept retrying.
- Replace `while (true)` with a check on `isNormalShutdown` and
the thread interrupt flag so the loop exits promptly.
- Break out of the retry path on CANCELLED when `isNormalShutdown`
is set, avoiding a misleading 5-second sleep after `close()`.
- Re-set the interrupt flag before breaking on InterruptedException
to preserve the interrupt contract for callers higher up.
Signed-off-by: Javier Aliaga <javier@diagrid.io>1 parent e5cf3f3 commit 307bbfd
1 file changed
Lines changed: 5 additions & 1 deletion
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
213 | 216 | | |
214 | 217 | | |
215 | 218 | | |
| |||
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
0 commit comments