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

bug: handle is already closing #610

Closed
2 tasks done
TM10YMhp opened this issue Dec 28, 2024 · 2 comments
Closed
2 tasks done

bug: handle is already closing #610

TM10YMhp opened this issue Dec 28, 2024 · 2 comments
Labels
bug Something isn't working P2 Not a priority. PRs welcome

Comments

@TM10YMhp
Copy link

TM10YMhp commented Dec 28, 2024

Neovim version (nvim -v)

NVIM v0.10.3

Operating system/version

Windows 10

Read debugging tips

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

2024-12-27 21:59:14[DEBUG] Running formatters on C:\Users\qwe\AppData\Local\nvim\a.java: { "google-java-format" }
2024-12-27 21:59:14[INFO] Run google-java-format on C:\Users\qwe\AppData\Local\nvim\a.java
2024-12-27 21:59:14[DEBUG] Run command: { "C:\\Users\\qwe\\AppData\\Local\\nvim-data\\mason\\bin\\google-java-format.CMD", "-" }
2024-12-27 21:59:14[DEBUG] Run default CWD: C:\Users\qwe\AppData\Local\nvim
2024-12-27 21:59:14[WARN] Formatter 'google-java-format' timeout
2024-12-27 21:59:14[INFO] google-java-format exited with code 1
2024-12-27 21:59:14[DEBUG] google-java-format stdout: { "" }
2024-12-27 21:59:14[DEBUG] google-java-format stderr: { "" }

2024-12-27 21:59:49[DEBUG] Running formatters on C:\Users\qwe\AppData\Local\nvim\a.blade.php: { "blade-formatter" }
2024-12-27 21:59:49[INFO] Run blade-formatter on C:\Users\qwe\AppData\Local\nvim\a.blade.php
2024-12-27 21:59:49[DEBUG] Run command: { "C:\\Users\\qwe\\AppData\\Local\\nvim-data\\mason\\bin\\blade-formatter.CMD", "--indent-inner-html", "--extra-liners=''", "--stdin" }
2024-12-27 21:59:49[DEBUG] Run default CWD: C:\Users\qwe\AppData\Local\nvim
2024-12-27 21:59:49[WARN] Formatter 'blade-formatter' timeout
2024-12-27 21:59:49[INFO] blade-formatter exited with code 1
2024-12-27 21:59:49[DEBUG] blade-formatter stdout: { "" }
2024-12-27 21:59:49[DEBUG] blade-formatter stderr: { "" }

2024-12-27 22:00:19[DEBUG] Running formatters on C:\Users\qwe\AppData\Local\nvim\lua\plugins\a.js: { "biome", "biome-organize-imports" }
2024-12-27 22:00:19[INFO] Run biome on C:\Users\qwe\AppData\Local\nvim\lua\plugins\a.js
2024-12-27 22:00:19[DEBUG] Run command: { "C:\\Users\\qwe\\AppData\\Local\\nvim-data\\mason\\bin\\biome.CMD", "format", "--stdin-file-path", "C:\\Users\\qwe\\AppData\\Local\\nvim\\lua\\plugins\\a.js" }
2024-12-27 22:00:19[DEBUG] Run default CWD: C:\Users\qwe\AppData\Local\nvim
2024-12-27 22:00:19[WARN] Formatter 'biome' timeout
2024-12-27 22:00:19[INFO] biome exited with code 1
2024-12-27 22:00:19[DEBUG] biome stdout: { "" }
2024-12-27 22:00:19[DEBUG] biome stderr: { "" }

2024-12-27 22:04:05[DEBUG] Running formatters on C:/Users/qwe/projects/lang/python/a.py: { "ruff_format" }
2024-12-27 22:04:05[INFO] Run ruff_format on C:/Users/qwe/projects/lang/python/a.py
2024-12-27 22:04:05[DEBUG] Run command: { "C:\\Users\\qwe\\AppData\\Local\\nvim-data\\mason\\bin\\ruff.CMD", "format", "--force-exclude", "--stdin-filename", "C:/Users/qwe/projects/lang/python/a.py", "-" }
2024-12-27 22:04:05[DEBUG] Run CWD: C:/Users/qwe/projects/lang/python
2024-12-27 22:04:05[WARN] Formatter 'ruff_format' timeout
2024-12-27 22:04:06[INFO] ruff_format exited with code 1
2024-12-27 22:04:06[DEBUG] ruff_format stdout: { "" }
2024-12-27 22:04:06[DEBUG] ruff_format stderr: { "" }

2024-12-27 22:05:05[DEBUG] Running formatters on C:\Users\qwe\AppData\Local\nvim\lua\plugins\formatting.lua: { "stylua" }
2024-12-27 22:05:05[INFO] Run stylua on C:\Users\qwe\AppData\Local\nvim\lua\plugins\formatting.lua
2024-12-27 22:05:05[DEBUG] Run command: { "C:\\Users\\qwe\\AppData\\Local\\nvim-data\\mason\\bin\\stylua.CMD", "--search-parent-directories", "--stdin-filepath", "C:\\Users\\qwe\\AppData\\Local\\nvim\\lua\\plugins\\formatting.lua", "-" }
2024-12-27 22:05:05[DEBUG] Run CWD: C:/Users/qwe/AppData/Local/nvim
2024-12-27 22:05:05[WARN] Formatter 'stylua' timeout
2024-12-27 22:05:06[INFO] stylua exited with code 1
2024-12-27 22:05:06[DEBUG] stylua stdout: { "" }
2024-12-27 22:05:06[DEBUG] stylua stderr: { "" }

Describe the bug

Since commit 42b53fc, of version 8.0.0, if a formatter exceeds timeout_ms the error handle is already closing occurs.

conform_2105

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

In my case, the error always occurs when I set timeout_ms = 50 using biome, ruff, blade-formatter, google-java-format, stylua, but it only does not occur with stylua and ruff when I set timeout_ms = 100.

Normally I set timeout_ms = 1000.

Expected Behavior

The error did not occur before this update.

Minimal example file

No response

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        -- add your config here
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response

@TM10YMhp TM10YMhp added the bug Something isn't working label Dec 28, 2024
@stevearc
Copy link
Owner

stevearc commented Jan 3, 2025

I can't reproduce this on mac or linux, and I don't have a windows machine at the moment. This looks like a crash in the internals of vim.system. You could try reporting it upstream to Neovim core

@stevearc stevearc added the P2 Not a priority. PRs welcome label Jan 3, 2025
@TM10YMhp
Copy link
Author

That's right, it was a bug in vim.system neovim/neovim#31442, upgrading to NVIM v0.11.0-dev-1557+ga78eddd541 fixed the problem, sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Not a priority. PRs welcome
Projects
None yet
Development

No branches or pull requests

2 participants