Commit 886b0bb
authored
[fix](memory-tracker) Avoid nested task attach in cloud snapshot manager (#63189)
Cloud download callback already attaches the `SnapshotLoader` resource
context.
During cloud restore,` CloudSnapshotLoader::download()` calls
`CloudSnapshotMgr::make_snapshot()`, which previously used
`SCOPED_ATTACH_TASK`
again and could hit `ThreadContext::attach_task() `DCHECK because task
attach is
not nestable.
Use `SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER` in `CloudSnapshotMgr`
and`SnapshotMgr` snapshot
operations avoiding the nested-attach pattern. These methods only need
to
account memory to the manager tracker, and limiter switching works both
with
and without an outer attached task context.1 parent c02bd65 commit 886b0bb
2 files changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
0 commit comments