nushell/crates/nu_plugin_custom_values/src
Devyn Cairns c82dfce246
Fix deadlock on PluginCustomValue drop (#12418)
# Description
Because the plugin interface reader thread can be responsible for
sending a drop notification, it's possible for it to end up in a
deadlock where it's waiting for the response to the drop notification
call.

I decided that the best way to address this is to just discard the
response and not wait for it. It's not really important to synchronize
with the response to `Dropped`, so this is probably faster anyway.

cc @ayax79, this is your issue where polars is getting stuck

# User-Facing Changes
- A bug fix
- Custom value plugin: `custom-value handle update` command

# Tests + Formatting

Tried to add a test with a long pipeline with a lot of drops and run it
over and over to reproduce the deadlock.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-04-05 21:57:00 -05:00
..
cool_custom_value.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
drop_check.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
generate2.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
generate.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
handle_custom_value.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
handle_get.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
handle_make.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
handle_update.rs Fix deadlock on PluginCustomValue drop (#12418) 2024-04-05 21:57:00 -05:00
main.rs Fix deadlock on PluginCustomValue drop (#12418) 2024-04-05 21:57:00 -05:00
second_custom_value.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00
update_arg.rs Change PluginCommand API to be more like Command (#12279) 2024-03-27 11:59:57 +01:00
update.rs Make drop notification timing for plugin custom values more consistent (#12341) 2024-04-04 09:13:25 +02:00