ZIm/crates
gcp-cherry-pick-bot[bot] 53bc5714d6
Fix racy leaked extension server adapters handling (cherry-pick #35319) (#35321)
Cherry-picked Kb/wasm panics (#35319)

Follow-up of https://github.com/zed-industries/zed/pull/34208
Closes https://github.com/zed-industries/zed/issues/35185

Previous code assumed that extensions' language server wrappers may leak
only in static data (e.g. fields that were not cleared on deinit), but
we seem to have a race that breaks this assumption.

1. We do clean `all_lsp_adapters` field after
https://github.com/zed-industries/zed/pull/34334 and it's called for
every extension that is unregistered.
2. `LspStore::maintain_workspace_config` ->
`LspStore::refresh_workspace_configurations` chain is triggered
independently, apparently on `ToolchainStoreEvent::ToolchainActivated`
event which means somewhere behind there's potentially a Python code
that gets executed to activate the toolchian, making
`refresh_workspace_configurations` start timings unpredictable.
3. Seems that toolchain activation overlaps with plugin reload, as 
`2025-07-28T12:16:19+03:00 INFO [extension_host] extensions updated.
loading 0, reloading 1, unloading 0` suggests in the issue logs.

The plugin reload seem to happen faster than workspace configuration
refresh in



c65da547c9/crates/project/src/lsp_store.rs (L7426-L7456)

as the language servers are just starting and take extra time to respond
to the notification.

At least one of the `.clone()`d `adapter`s there is the adapter that got
removed during plugin reload and has its channel closed, which causes a
panic later.

----------------------------

A good fix would be to re-architect the workspace refresh approach, same
as other accesses to the language server collections.
One way could be to use `Weak`-based structures instead, as definitely
the extension server data belongs to extension, not the `LspStore`.
This is quite a large undertaking near the extension core though, so is
not done yet.

Currently, to stop the excessive panics, no more `.expect` is done on
the channel result, as indeed, it now can be closed very dynamically.
This will result in more errors (and backtraces, presumably) printed in
the logs and no panics.

More logging and comments are added, and workspace querying is replaced
to the concurrent one: no need to wait until a previous server had
processed the notification to send the same to the next one.

Release Notes:

- Fixed warm-related panic happening during startup

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-07-30 12:56:03 +03:00
..
acp Tweaks to ACP for the Gemini PR (#34506) 2025-07-15 17:52:50 -06:00
activity_indicator debugger: Improve appearance of session list for JavaScript debugging (#34322) 2025-07-12 15:56:05 +00:00
agent Don't auto-retry in certain circumstances (#35037) 2025-07-24 11:52:10 -04:00
agent_servers Tweaks to ACP for the Gemini PR (#34506) 2025-07-15 17:52:50 -06:00
agent_settings agent: Add setting to control terminal card expanded state (#34061) 2025-07-08 10:43:35 -03:00
agent_ui agent: Fix double-lease panic when clicking on thread to jump (cherry-pick #34843) (#34874) 2025-07-24 00:30:07 +02:00
anthropic agent: Improve error handling and retry for zed-provided models (#33565) 2025-06-30 21:01:32 -06:00
askpass Revert "git: Intercept signing prompt from GPG when committing" (#34306) 2025-07-11 23:20:35 +00:00
assets Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
assistant_context agent: Disable thinking when using inline assistant/edit file tool (#34141) 2025-07-09 18:05:39 +00:00
assistant_slash_command Stop extensions' servers and message loops before removing their files (#34208) 2025-07-10 19:25:10 +00:00
assistant_slash_commands chore: Bump Rust version to 1.88 (#33439) 2025-06-26 20:54:19 +02:00
assistant_tool agent: Push diffs of user edits to the agent (#34487) 2025-07-16 14:38:58 +00:00
assistant_tools Improve upstream error reporting (#34668) 2025-07-17 19:23:34 -04:00
audio agent: Add sound notification when done generating (#31472) 2025-05-26 21:20:41 -03:00
auto_update windows: Publish nightly (#24800) 2025-07-09 08:57:03 +08:00
auto_update_helper windows: Publish nightly (#24800) 2025-07-09 08:57:03 +08:00
auto_update_ui Fix documentation of view release notes actions (#33851) 2025-07-03 14:22:28 +00:00
aws_http_client Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
bedrock bedrock: Fix bedrock not streaming (#28281) 2025-07-01 12:51:09 +03:00
breadcrumbs breadcrumbs: Stylize filename in breadcrumbs when tab-bar is off and file is dirty (#30507) 2025-05-30 08:32:54 -07:00
buffer_diff chore: Bump Rust version to 1.88 (#33439) 2025-06-26 20:54:19 +02:00
call Fix screenshare sources error handling, is_sharing_screen() == false on error (#34250) 2025-07-10 23:35:21 +00:00
channel Fetch and wait for channels when opening channel notes via URL (#33291) 2025-06-24 05:14:15 +00:00
cli cli: Remove manual std::io::copy implementation (#34409) 2025-07-15 16:37:15 +02:00
client client: Send User-Agent header on WebSocket connection requests (cherry-pick #35280) (#35284) 2025-07-29 13:26:02 -04:00
clock Add the ability to follow the agent as it makes edits (#29839) 2025-05-04 08:28:39 +00:00
collab collab: Remove GET /billing/preferences endpoint (#34566) 2025-07-16 17:55:01 +00:00
collab_ui gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
collections Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
command_palette Sketch in a table for the keybindings UI (#32436) 2025-06-30 19:25:11 -04:00
command_palette_hooks Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
component ui: Add Chip component (#34521) 2025-07-16 01:15:45 -03:00
context_server agent: Use standardized MCP configuration format in settings (#33539) 2025-06-30 08:05:52 +00:00
copilot copilot: Indicate whether a request is initiated by an agent to Copilot API (#33895) 2025-07-07 10:24:17 +02:00
credentials_provider Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
dap debugger: Improve appearance of session list for JavaScript debugging (#34322) 2025-07-12 15:56:05 +00:00
dap_adapters debugger: Interpret user-specified debug adapter binary paths in a more intuitive way for JS and Python (#33926) 2025-07-15 22:31:28 +00:00
db Misc nitpicks, changes too small / unrelated to be in other PRs (#32768) 2025-06-15 19:51:04 +00:00
debug_adapter_extension Allow remote loading for DAP-only extensions (#33981) 2025-07-06 14:52:16 +02:00
debugger_tools debugger: Improve appearance of session list for JavaScript debugging (#34322) 2025-07-12 15:56:05 +00:00
debugger_ui debugger: Improve drag-and-scroll in memory views (#34526) 2025-07-16 10:00:36 +00:00
deepseek language_models: Emit UsageUpdate events for token usage in DeepSeek and OpenAI (#33242) 2025-06-25 09:42:30 +02:00
diagnostics lsp: Fix workspace diagnostics lag & add streaming support (#34022) 2025-07-15 18:41:45 +03:00
docs_preprocessor gpui: Reduce manual shifting & other minor improvements (#34407) 2025-07-15 16:39:33 +02:00
editor Cache LSP code lens requests (cherry-pick #35207) (#35258) 2025-07-29 10:21:51 +03:00
eval gpui: Add use state APIs (#34741) 2025-07-23 12:16:25 -04:00
explorer_command_injector Just Zed instead of Zed Editor (#34146) 2025-07-10 21:08:43 +02:00
extension Stop extensions' servers and message loops before removing their files (#34208) 2025-07-10 19:25:10 +00:00
extension_api Move language-specific debugging docs to the page for each language (#33692) 2025-07-01 20:02:12 +00:00
extension_cli extension_cli: Copy over snippet file when bundling extensions (#34450) 2025-07-15 11:07:29 +00:00
extension_host Fix racy leaked extension server adapters handling (cherry-pick #35319) (#35321) 2025-07-30 12:56:03 +03:00
extensions_ui ui: Add Chip component (#34521) 2025-07-16 01:15:45 -03:00
feature_flags Route all LLM traffic through cloud.zed.dev (#34404) 2025-07-14 16:03:19 +00:00
feedback gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
file_finder windows: Add support for SSH (#29145) 2025-07-08 14:34:57 +00:00
file_icons Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fs git: Handle shift-click to stage a range of entries in the panel (#34296) 2025-07-12 19:04:26 +00:00
fsevent Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
fuzzy editor: Improve code completion filtering to provide fewer and more accurate suggestions (#32928) 2025-06-18 16:01:28 +05:30
git git: Handle shift-click to stage a range of entries in the panel (#34296) 2025-07-12 19:04:26 +00:00
git_hosting_providers Allow configuring custom git hosting providers in project settings (#31929) 2025-06-03 12:23:01 -04:00
git_ui editor: Improve minimap performance (#33067) 2025-07-15 00:29:27 +03:00
go_to_line Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
google_ai Update Gemini Models (#32902) 2025-06-17 20:26:27 +00:00
gpui client: Send User-Agent header on WebSocket connection requests (cherry-pick #35280) (#35284) 2025-07-29 13:26:02 -04:00
gpui_macros gpui: Add use state APIs (#34741) 2025-07-23 12:16:25 -04:00
gpui_tokio Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
html_to_markdown agent: Fix crash with pathological fetch output (#34253) 2025-07-11 21:01:09 -04:00
http_client client: Send User-Agent header on WebSocket connection requests (cherry-pick #35280) (#35284) 2025-07-29 13:26:02 -04:00
http_client_tls Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
icons Add exact matching option to keymap editor search (#34497) 2025-07-16 12:14:09 -04:00
image_viewer Option to auto-close deleted files with no unsaved edits (#31920) 2025-06-03 13:18:29 +02:00
indexed_docs Stop extensions' servers and message loops before removing their files (#34208) 2025-07-10 19:25:10 +00:00
inline_completion agent: Fix issues with usage display sometimes showing initially fetched usage (#33125) 2025-06-20 21:28:48 +00:00
inline_completion_button Another lsp tool UI migration (#34009) 2025-07-07 14:28:18 +00:00
inspector_ui Fix anchor biases for completion replacement ranges (esp slash commands) (#32262) 2025-06-06 20:54:00 +00:00
install_cli gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
jj Add a picker for jj bookmark list (#30883) 2025-05-17 16:42:45 +00:00
jj_ui editor: Improve code completion filtering to provide fewer and more accurate suggestions (#32928) 2025-06-18 16:01:28 +05:30
journal gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
language Fix redo after noop format (cherry-pick #34898) (#34903) 2025-07-22 13:56:45 -04:00
language_extension Stop extensions' servers and message loops before removing their files (#34208) 2025-07-10 19:25:10 +00:00
language_model Improve upstream error reporting (#34668) 2025-07-17 19:23:34 -04:00
language_models agent: Fix Mistral tool use error message (#34692) 2025-07-21 09:22:18 -04:00
language_selector gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
language_tools lsp tool: Make "Restart All Servers" always visible (#34255) 2025-07-10 22:00:01 -03:00
languages keymap_ui: Auto complete action arguments (cherry-pick #34785) (#34790) 2025-07-20 17:07:39 -04:00
livekit_api Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
livekit_client Windows screen sharing (#34223) 2025-07-10 14:02:00 -07:00
lmstudio Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
lsp lsp: Fix workspace diagnostics lag & add streaming support (#34022) 2025-07-15 18:41:45 +03:00
markdown gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
markdown_preview gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
media Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
menu gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
migrator editor: Change drag_and_drop_selection cursor on delay elapsed + Add drag_and_drop_selection delay setting (#33928) 2025-07-09 12:38:23 +05:30
mistral Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
multi_buffer Don't highlight partial indent guide backgrounds (#34433) 2025-07-16 09:10:51 -04:00
net windows: Add support for SSH (#29145) 2025-07-08 14:34:57 +00:00
node_runtime Replace async-watch with a custom watch (#32245) 2025-06-06 16:00:09 +00:00
notifications notification: Add built-in dismiss button in the Status Toast component (#33278) 2025-06-23 19:55:21 -03:00
ollama Standardize on u64 for token counts (#32869) 2025-06-17 10:43:07 -04:00
open_ai open_ai: Make OpenAI error message generic (#33383) 2025-06-28 14:38:27 +02:00
open_router open_router: Fix tool_choice getting serialized to null (#34532) 2025-07-16 11:44:08 -04:00
outline Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
outline_panel project panel: Add indent guides for sticky items (#34092) 2025-07-09 05:28:25 +05:30
panel git panel: Add some design refinements (#34064) 2025-07-08 11:23:36 -03:00
paths ACP (#34030) 2025-07-09 16:02:31 +00:00
picker gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
prettier Expand Prettier config list (#33744) 2025-07-02 08:44:14 +00:00
project Fix racy leaked extension server adapters handling (cherry-pick #35319) (#35321) 2025-07-30 12:56:03 +03:00
project_panel theme: Add panel.overlay_background and panel.overlay_hover (cherry-pick #34655) (#34878) 2025-07-22 20:55:09 +05:30
project_symbols Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
prompt_store editor: Improve code completion filtering to provide fewer and more accurate suggestions (#32928) 2025-06-18 16:01:28 +05:30
proto Revert "git: Intercept signing prompt from GPG when committing" (#34306) 2025-07-11 23:20:35 +00:00
recent_projects windows: Add support for SSH (#29145) 2025-07-08 14:34:57 +00:00
refineable Add a live Rust style editor to inspector to edit a sequence of no-argument style modifiers (#31443) 2025-05-26 17:43:57 +00:00
release_channel Use shortened SHA when displaying version to install (#31281) 2025-05-23 14:53:53 +00:00
remote windows: Don't show cmd window when remoting (#34187) 2025-07-10 09:19:12 +00:00
remote_server Stop extensions' servers and message loops before removing their files (#34208) 2025-07-10 19:25:10 +00:00
repl editor: Improve minimap performance (#33067) 2025-07-15 00:29:27 +03:00
reqwest_client client: Send User-Agent header on WebSocket connection requests (cherry-pick #35280) (#35284) 2025-07-29 13:26:02 -04:00
rich_text Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
rope chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
rpc extensions: Add "Debug Adapters" category to the extension store (#32845) 2025-06-17 12:09:08 +02:00
rules_library Remove auto-width editor type (#34438) 2025-07-15 17:36:09 +00:00
schema_generator Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
search Refine status bar design (#34324) 2025-07-12 11:48:19 -03:00
semantic_index agent: Disable thinking when using inline assistant/edit file tool (#34141) 2025-07-09 18:05:39 +00:00
semantic_version Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
session Avoid unnecessary DB writes (#29417) 2025-04-25 17:41:49 +03:00
settings keymap_ui: Dim keybinds that are overridden by other keybinds (#34952) 2025-07-23 12:08:24 -04:00
settings_ui keymap_ui: Fix bug introduced in #35208 (cherry-pick #35237) (#35239) 2025-07-28 18:02:05 -04:00
snippet Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
snippet_provider Default `#[schemars(deny_unknown_fields)] for json-language-server schemas (#33883) 2025-07-04 00:57:43 +00:00
snippets_ui gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
sqlez Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
sqlez_macros Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
story gpui: Add a standard text example (#30747) 2025-05-16 17:35:44 +02:00
storybook project panel: Add indent guides for sticky items (#34092) 2025-07-09 05:28:25 +05:30
streaming_diff Introduce a new StreamingEditFileTool (#29733) 2025-05-01 17:37:43 +02:00
sum_tree chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
supermaven gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
supermaven_api supermaven_api: Ensure downloaded Supermaven binary has executable permissions set (#32576) 2025-06-17 14:39:45 +00:00
svg_preview gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
tab_switcher gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
task Add support for Nushell in shell builder (#33806) 2025-07-08 14:57:37 +00:00
tasks_ui Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
telemetry Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
telemetry_events Add new action to run agent eval (#29158) 2025-04-21 21:30:21 -07:00
terminal Appropriately pick venv activation script (#33205) 2025-07-16 12:52:37 +00:00
terminal_view Fix positioning of terminal inline assist after clearing the screen (#34465) 2025-07-15 15:16:48 -04:00
text Fix redo after noop format (cherry-pick #34898) (#34903) 2025-07-22 13:56:45 -04:00
theme theme: Add panel.overlay_background and panel.overlay_hover (cherry-pick #34655) (#34878) 2025-07-22 20:55:09 +05:30
theme_extension Add workspace-hack (#27277) 2025-04-02 13:26:34 -07:00
theme_importer chore: Bump Rust version to 1.88 (#33439) 2025-06-26 20:54:19 +02:00
theme_selector Add zed://extension/{id} links (#34492) 2025-07-15 13:42:25 -06:00
time_format agent: Add date separators to Thread History (#29961) 2025-05-06 10:18:48 +00:00
title_bar keymap_ui: Open Keymap editor from settings dropdown (#34576) 2025-07-17 13:37:58 -04:00
toolchain_selector gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
ui keymap_ui: Improve keybind display in menus (cherry-pick #34587) (#34632) 2025-07-17 11:34:44 -04:00
ui_input keymap_ui: Create language for Zed keybind context (#34558) 2025-07-16 17:00:47 +00:00
ui_macros Update syn crate from 1.0.109 to 2.0.101 (#31301) 2025-05-23 19:31:25 +00:00
ui_prompt Add element_selection_background highlight to theme (#32388) 2025-06-27 15:46:04 +00:00
util windows: Add support for SSH (#29145) 2025-07-08 14:34:57 +00:00
util_macros Remove separator! macro and make path! handle relative paths (#32527) 2025-06-13 06:32:29 +00:00
vercel vercel: Use proper model identifiers and add image support (#33377) 2025-06-25 13:26:41 +00:00
vim lsp: Wait for shutdown response before sending exit notification (#33417) 2025-07-15 18:30:57 +03:00
vim_mode_setting vim: Fix escape key switching back to default mode instead of normal mode (#31843) 2025-06-18 21:26:12 +00:00
watch chore: Fix warnings for Rust 1.89 (#32378) 2025-06-09 13:11:57 +02:00
web_search agent: Expose web search tool to beta users (#29273) 2025-04-23 15:30:20 +00:00
web_search_providers Route all LLM traffic through cloud.zed.dev (#34404) 2025-07-14 16:03:19 +00:00
welcome keymap_ui: Add auto-complete for context in keybind editor (#34031) 2025-07-07 21:54:51 +00:00
workspace Fix tasks leaked despite workspace window close (cherry-pick #35246) (#35251) 2025-07-29 10:21:25 +03:00
worktree chore: Bump Rust version to 1.88 (#33439) 2025-06-26 20:54:19 +02:00
x_ai Add xAI language model provider (#33593) 2025-07-15 15:35:50 -04:00
zed zed 0.196.7 2025-07-29 14:38:01 -04:00
zed_actions Add zed://extension/{id} links (#34492) 2025-07-15 13:42:25 -06:00
zeta Route all LLM traffic through cloud.zed.dev (#34404) 2025-07-14 16:03:19 +00:00
zlog Initialize zlog default filters on init rather than waiting for settings load (#32209) 2025-06-06 00:49:30 -06:00
zlog_settings VSCode Settings import (#29018) 2025-04-23 20:54:09 +00:00