Commit 303e781
committed
fix: properly handle async service cleanup in LocalBackend.close()
The close() method was calling service.close() without checking if it was
async, causing resource leaks when services had async cleanup methods.
This fix:
- Makes LocalBackend.close() async to match the base Backend class
- Properly awaits async service close methods
- Maintains backward compatibility for sync close methods
- Handles __exit__ context manager compatibility
Prevents GPU memory leaks and zombie processes in production deployments.1 parent 538a662 commit 303e781
1 file changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
94 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
95 | 105 | | |
96 | 106 | | |
97 | 107 | | |
| |||
0 commit comments