]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update release notes
authorSebastián Ramírez <tiangolo@gmail.com>
Sat, 24 Feb 2024 23:18:13 +0000 (00:18 +0100)
committerSebastián Ramírez <tiangolo@gmail.com>
Sat, 24 Feb 2024 23:18:13 +0000 (00:18 +0100)
docs/en/docs/release-notes.md

index 2e8930ea3c980d648f246df6ae466f2050df272a..c442f1449d741e91ecade0818cb003b842a54dc9 100644 (file)
@@ -10,6 +10,29 @@ hide:
 ### Breaking Changes
 
 * 🐛 Fix unhandled growing memory for internal server errors, refactor dependencies with `yield` and `except` to require raising again as in regular Python. PR [#11191](https://github.com/tiangolo/fastapi/pull/11191) by [@tiangolo](https://github.com/tiangolo).
+    * This is a breaking change (and only slightly) if you used dependencies with `yield`, used `except` in those dependencies, and didn't raise again.
+    * This was reported internally by [@rushilsrivastava](https://github.com/rushilsrivastava) as a memory leak when the server had unhandled exceptions that would produce internal server errors, the memory allocated before that point would not be released.
+    * Read the new docs: [Dependencies with `yield` and `except`](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#dependencies-with-yield-and-except).
+
+In short, if you had dependencies that looked like:
+
+```Python
+def my_dep():
+    try:
+        yield
+    except SomeException:
+        pass
+```
+
+Now you need to make sure you raise again after `except`, just as you would in regular Python:
+
+```Python
+def my_dep():
+    try:
+        yield
+    except SomeException:
+        raise
+```
 
 ### Docs