You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When fetching/building grammars it's done in a thread pool where the results are communicated over a channel. On the first failure the receiver is closed and the error returned. This causes any sends that aren't completed yet to panic, spamming the terminal with jumbled error messages.
The panicing function is this (annotations mine)
fnrun_parallel<F>(grammars:Vec<GrammarConfiguration>,job:F,action:&'staticstr) -> Result<()>whereF:Fn(GrammarConfiguration) -> Result<()> + std::marker::Send + 'static + Copy,{let pool = threadpool::Builder::new().build();let(tx, rx) = channel();for grammar in grammars {let tx = tx.clone();
pool.execute(move || {
tx.send(job(grammar)).unwrap();// <- this panics since rx is closed});}drop(tx);// TODO: print all failures instead of the first one found.
rx.iter().find(|result| result.is_err()).map(|err| err.with_context(|| format!("Failed to {} some grammar(s)", action))).unwrap_or(Ok(()))// <- on the first error this returns, closing rx and causing any subsequent sends to fail}
One solution could be to simply ignore the Results produced by tx.send (#2641). Another could be to use something like https://docs.rs/beau_collector/latest/beau_collector/ to collect all the errors into a single error that can be returned.
Summary
When fetching/building grammars it's done in a thread pool where the results are communicated over a channel. On the first failure the receiver is closed and the error returned. This causes any sends that aren't completed yet to panic, spamming the terminal with jumbled error messages.
The panicing function is this (annotations mine)
One solution could be to simply ignore the
Result
s produced bytx.send
(#2641). Another could be to use something like https://docs.rs/beau_collector/latest/beau_collector/ to collect all the errors into a single error that can be returned.Reproduction Steps
$ mkdir runtime_test $ sudo chown root:root runtime_test $ HELIX_RUNTIME=$PWD/runtime_test hx -g fetch
Helix log
No response
Platform
Linux
Terminal Emulator
kitty
Helix Version
22.05-14-gfc666db6
The text was updated successfully, but these errors were encountered: