Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Project strong reference leaks #22470

Merged
merged 2 commits into from
Dec 28, 2024
Merged

Fix Project strong reference leaks #22470

merged 2 commits into from
Dec 28, 2024

Conversation

SomeoneToIgnore
Copy link
Contributor

Closes #21906

  • After Allow splitting the terminal panel #21238, TerminalPanel and Project strong references were moved into Pane-related closures, creating a cycle, that did not allow registering project release and shutting down corresponding language servers

  • After Make git panel entries clickable #22329, a special Editor was created with a strong reference to the Project which seemed to do nothing bad in general, but when a working Zed was running a Zed Dev build, had the same issue with preventing language servers from shutting down.

The latter is very odd, and seems quite dangerous, as any arbitrary Editor with Project in it may do the same, yet it seems that we did not store them before the way git panel does.

I have tried creating a test, yet seems that we need to initialize a lot of Zed for it which I failed — all my attempts resulted in a single language server being present in the Project's statuses.

Release Notes:

  • Fixed language servers not being released between project reopens

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 28, 2024
@SomeoneToIgnore SomeoneToIgnore changed the title Kb/fix leaks Fix Project strong reference leaks Dec 28, 2024
@SomeoneToIgnore SomeoneToIgnore added this pull request to the merge queue Dec 28, 2024
Merged via the queue into main with commit ac60dcd Dec 28, 2024
14 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the kb/fix-leaks branch December 28, 2024 17:32
@SomeoneToIgnore
Copy link
Contributor Author

/cherry-pick v0.167.x

Copy link

Cherry-pick failed with Merge error ac60dcd67a82f6aa76608fc9bca6070f78f75751 into temp-cherry-pick-cf3a50-v0.167.x

SomeoneToIgnore added a commit that referenced this pull request Dec 28, 2024
Closes #21906

* After #21238,
`TerminalPanel` and `Project` strong references were moved into
`Pane`-related closures, creating a cycle, that did not allow
registering project release and shutting down corresponding language
servers

* After #22329, a special
`Editor` was created with a strong reference to the `Project` which
seemed to do nothing bad in general, but when a working Zed was running
a Zed Dev build, had the same issue with preventing language servers
from shutting down.

The latter is very odd, and seems quite dangerous, as any arbitrary
`Editor` with `Project` in it may do the same, yet it seems that we did
not store them before the way git panel does.

I have tried creating a test, yet seems that we need to initialize a lot
of Zed for it which I failed — all my attempts resulted in a single
language server being present in the `Project`'s statuses.

Release Notes:

- Fixed language servers not being released between project reopens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

language server not release when using open recents switch project
1 participant