Commit f8580f0
authored
use empty context in restore budget task (#122)
Why
===
By default, new asyncio tasks hold onto a reference to the current
context. If the user of river has a lot of data in the context while the
restore budget task is created, that context cannot be GC'd until the
task exits. This can lead to accidental memory leaks.
As a followup we will replace this rate limiter with one that does not
require background tasks.
What changed
============
- Create a fresh context for restore budget task
Test plan
=========
- Shouldn't have any behavior impact here, we don't rely on the context
for budget restoration.
- We should see fewer memory leaks internally1 parent 4ccbd27 commit f8580f0
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
86 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
0 commit comments