Commit 9e102bc
Fix memory leak from cancelled timeout tasks in CopilotSession
Replace Executors.newSingleThreadScheduledExecutor with an explicit
ScheduledThreadPoolExecutor so we can enable removeOnCancelPolicy(true).
Without this, each call to sendAndWait() that completes normally cancels
its timeout task, but the cancelled task remains in the scheduler's work
queue, leaking memory over the lifetime of the session.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Ed Burns <edburns@microsoft.com>1 parent a36d145 commit 9e102bc
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
159 | 160 | | |
160 | 161 | | |
161 | 162 | | |
162 | | - | |
| 163 | + | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| 168 | + | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
0 commit comments