Commit 5fa222f
fix: fastapi memory leak only (#3688)
* fix(fastapi-instrumentation): properly remove app from instrumented list to avoid memory leaks
* fix(fastapi-instrumentation): fix tests and finalize memory leak fix
* docs(changelog): add FastAPI uninstrument memory leak fix with PR references (#3683)
* test(fastapi): add GC-based app collection test; refactor tracking to WeakSet and safe discard
* docs(changelog): reference FastAPI memory leak fix PR (#3688)
* refactor(fastapi): drop __del__ as WeakSet handles cleanup
* chore(fastapi): formatting after ruff auto-fix
* chore(test-fastapi): ruff import order
* Update comment to clarify purpose of removing app from WeakSet
* fix: codereview comments
* Apply suggestions from code review
---------
Co-authored-by: Emídio Neto <[email protected]>
Co-authored-by: Riccardo Magliocchetti <[email protected]>1 parent 3567a03 commit 5fa222f
File tree
3 files changed
+27
-6
lines changed- instrumentation/opentelemetry-instrumentation-fastapi
- src/opentelemetry/instrumentation/fastapi
- tests
3 files changed
+27
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
361 | 367 | | |
362 | 368 | | |
363 | 369 | | |
| |||
388 | 394 | | |
389 | 395 | | |
390 | 396 | | |
391 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
392 | 402 | | |
393 | 403 | | |
394 | 404 | | |
| |||
406 | 416 | | |
407 | 417 | | |
408 | 418 | | |
409 | | - | |
| 419 | + | |
| 420 | + | |
410 | 421 | | |
411 | 422 | | |
412 | 423 | | |
| |||
426 | 437 | | |
427 | 438 | | |
428 | 439 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | 440 | | |
434 | 441 | | |
435 | 442 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
1400 | 1402 | | |
1401 | 1403 | | |
1402 | 1404 | | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
1403 | 1415 | | |
1404 | 1416 | | |
1405 | 1417 | | |
| |||
0 commit comments