Commit f4d38d6
authored
fix(plugins): release a CLI pipe when the plugin handling it crashes (#5537)
apply_pipe_message_to_plugin sends UnblockCliPipes on every success path,
including the path for old plugins that do not export `pipe`, but not when
the call into the plugin fails. When a plugin traps while handling a pipe
message, both call sites in wasm_bridge only log and call handle_plugin_crash,
which paints a loading-indication error on the pane and does not unload the
plugin. The (plugin_id, client_id) entry therefore stays in PendingPipes and
the `zellij pipe` client blocks until the plugin is unloaded or the session
ends.
Move the body to apply_pipe_message_to_plugin_inner and have the wrapper
release the pipe on any error before re-returning it, so neither call site
can forget.
Adds a regression test driving a fixture-plugin branch that panics while
handling a pipe, asserting UnblockCliPipeInput is emitted at crash time
rather than at teardown.1 parent 035876d commit f4d38d6
4 files changed
Lines changed: 132 additions & 0 deletions
File tree
- default-plugins/fixture-plugin-for-tests/src
- zellij-server/src/plugins
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
| 996 | + | |
| 997 | + | |
996 | 998 | | |
997 | 999 | | |
998 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
147 | 188 | | |
148 | 189 | | |
149 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13211 | 13211 | | |
13212 | 13212 | | |
13213 | 13213 | | |
| 13214 | + | |
| 13215 | + | |
| 13216 | + | |
| 13217 | + | |
| 13218 | + | |
| 13219 | + | |
| 13220 | + | |
| 13221 | + | |
| 13222 | + | |
| 13223 | + | |
| 13224 | + | |
| 13225 | + | |
| 13226 | + | |
| 13227 | + | |
| 13228 | + | |
| 13229 | + | |
| 13230 | + | |
| 13231 | + | |
| 13232 | + | |
| 13233 | + | |
| 13234 | + | |
| 13235 | + | |
| 13236 | + | |
| 13237 | + | |
| 13238 | + | |
| 13239 | + | |
| 13240 | + | |
| 13241 | + | |
| 13242 | + | |
| 13243 | + | |
| 13244 | + | |
| 13245 | + | |
| 13246 | + | |
| 13247 | + | |
| 13248 | + | |
| 13249 | + | |
| 13250 | + | |
| 13251 | + | |
| 13252 | + | |
| 13253 | + | |
| 13254 | + | |
| 13255 | + | |
| 13256 | + | |
| 13257 | + | |
| 13258 | + | |
| 13259 | + | |
| 13260 | + | |
| 13261 | + | |
| 13262 | + | |
| 13263 | + | |
| 13264 | + | |
| 13265 | + | |
| 13266 | + | |
| 13267 | + | |
| 13268 | + | |
| 13269 | + | |
| 13270 | + | |
| 13271 | + | |
| 13272 | + | |
| 13273 | + | |
| 13274 | + | |
| 13275 | + | |
| 13276 | + | |
| 13277 | + | |
| 13278 | + | |
| 13279 | + | |
| 13280 | + | |
| 13281 | + | |
| 13282 | + | |
| 13283 | + | |
| 13284 | + | |
| 13285 | + | |
| 13286 | + | |
| 13287 | + | |
| 13288 | + | |
| 13289 | + | |
| 13290 | + | |
| 13291 | + | |
| 13292 | + | |
| 13293 | + | |
| 13294 | + | |
| 13295 | + | |
| 13296 | + | |
| 13297 | + | |
| 13298 | + | |
| 13299 | + | |
| 13300 | + | |
| 13301 | + | |
0 commit comments