Commit aad7c66
authored
[Flight] Don't try to close debug channel twice (facebook#34340)
When the debug channel was already closed, we must not try to close it
again when the Response gets garbage collected.
**Test plan:**
1. reduce the Flight fixture `App` component to a minimum [^1]
- remove everything from `<body>`
- delete the `console.log` statement
2. open the app in Firefox (seems to have a more aggressive GC strategy)
3. wait a few seconds
On `main`, you will see the following error in the browser console:
```
TypeError: Can not close stream after closing or error
```
With this change, the error is gone.
[^1]: It's a bit concerning that step 1 is needed to reproduce the
issue. Either GC is behaving differently with the unmodified App, or we
may hold on to the Response under certain conditions, potentially
creating a memory leak. This needs further investigation.1 parent 3fe51c9 commit aad7c66
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
1013 | | - | |
1014 | | - | |
| 1013 | + | |
| 1014 | + | |
1015 | 1015 | | |
1016 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1017 | 1022 | | |
1018 | 1023 | | |
1019 | 1024 | | |
| |||
2434 | 2439 | | |
2435 | 2440 | | |
2436 | 2441 | | |
2437 | | - | |
| 2442 | + | |
2438 | 2443 | | |
2439 | 2444 | | |
2440 | 2445 | | |
| |||
0 commit comments