Commit 95735d0
committed
Clean up Observation from context after command completion.
We now restore the previous Observation parent after completing the Observation to avoid unintentional nesting of observations. Previously, a command became the parent of an earlier command on the same thread regardless of whether the earlier command has been finished or whether it was active.
Observation nesting now considers only commands that are still active restoring their parent after completion to avoid invalid nesting and with that, to not allocate observation graphs that allocate infinite memory.1 parent e1281a3 commit 95735d0
File tree
3 files changed
+62
-25
lines changed- spring-data-mongodb/src
- main/java/org/springframework/data/mongodb/observability
- test/java/org/springframework/data/mongodb/observability
3 files changed
+62
-25
lines changedLines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 32 | + | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 38 | | |
46 | 39 | | |
47 | 40 | | |
48 | | - | |
49 | 41 | | |
50 | | - | |
| 42 | + | |
51 | 43 | | |
52 | 44 | | |
53 | 45 | | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
57 | 49 | | |
58 | | - | |
| 50 | + | |
59 | 51 | | |
60 | 52 | | |
61 | 53 | | |
| |||
Lines changed: 18 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | 116 | | |
121 | 117 | | |
122 | 118 | | |
| |||
141 | 137 | | |
142 | 138 | | |
143 | 139 | | |
144 | | - | |
| 140 | + | |
145 | 141 | | |
146 | 142 | | |
147 | 143 | | |
148 | 144 | | |
149 | 145 | | |
150 | 146 | | |
151 | | - | |
152 | | - | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
156 | 150 | | |
157 | 151 | | |
158 | 152 | | |
159 | | - | |
| 153 | + | |
160 | 154 | | |
161 | 155 | | |
162 | 156 | | |
| |||
165 | 159 | | |
166 | 160 | | |
167 | 161 | | |
168 | | - | |
169 | 162 | | |
170 | 163 | | |
171 | 164 | | |
172 | 165 | | |
173 | | - | |
174 | | - | |
| 166 | + | |
| 167 | + | |
175 | 168 | | |
176 | 169 | | |
177 | 170 | | |
178 | 171 | | |
179 | | - | |
| 172 | + | |
180 | 173 | | |
181 | 174 | | |
182 | 175 | | |
| |||
188 | 181 | | |
189 | 182 | | |
190 | 183 | | |
191 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
192 | 196 | | |
193 | 197 | | |
194 | 198 | | |
| |||
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
213 | | - | |
| 217 | + | |
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
254 | 295 | | |
255 | 296 | | |
256 | 297 | | |
| |||
0 commit comments