-
Notifications
You must be signed in to change notification settings - Fork 59
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: tasks dispose inconsistently #315
Comments
This is likely due to this change 9162631, and is mostly intentional. The default behavior of the |
@stevearc The tasks dispose now indeed, but the orchestrators are not disposing anymore like they used to. Before disposing triggerAfter disposing trigger |
Do I also have to add the component to the orchestrator? If so that's gonna add a big chunk of boilerplate, I'm gonna try tomorrow. |
Yeah indeed... that was the issue. if this is the case, component_aliases = {
-- Components included in default will apply to all tasks
default = {
{ "display_duration", detail_level = 2 },
"on_output_summarize",
"on_exit_set_status",
"on_complete_notify", -- comment this to disable notifications
{ "on_complete_dispose", timeout=300 }
},
},
|
This can be closed now but there is something I've noticed if you are interested:
I would advice against this default, and going back to the old |
This shouldn't be the case. We start a repeating timer for exactly this reason, and I tested this a few times with a short timeout. Once the user views the task, it gets disposed when the timer next runs overseer.nvim/lua/overseer/component/on_complete_dispose.lua Lines 70 to 79 in 6271cab
If you have a reliable repro, could you file it as a bug?
I think this is fine. The pitfall I wanted to avoid is when a user starts a task that takes a while (one or more minutes), gets busy doing something else, then when they think to check back up on it, it has already been disposed and it's impossible to check the output or even see the status. That's a pretty bad experience that I've personally encountered several times. On the other side, if you have a task or set of tasks that you don't care about preserving the output of, there are a number of ways to adjust the components to get that behavior. |
@stevearc I've recorded a video demo: https://www.youtube.com/watch?v=BCgMkNAN4Gs |
I've added some additional debug logging to the Another useful tool in debugging is pulling up the "task edit" window by pressing I am not sure exactly what is happening in your video. I tried to replicate it (using a shorter timeout, because I do not have the patience you do), and the tasks seem to dispose correctly. One thing that I did have to change was the orchestrator tasks were being created with the default components; I had to also set them to use If you're still seeing dispose issues, try to get me a minimal init.lua config that will reproduce the issue. It's possible there's some difference in our configs that accounts for the difference. |
Hi @stevearc sorry it took me a bit to find time to test in a meaningful way. I've been testing with this minimal_file and it's weird: What it worksThe component
What doesn't workThe same component but without After the default 300 seconds, tasks are disposed inconsistently, or not at all. What doesn't work (neither)The same component but without
And then manually executing More infoThis is very weird because according to the source code of the on_complete_dispose component, we are doing the same thing as the default, the only thing changing is the timeout (from 300s to 10s) |
Okay let's take this case by case Case 1{
{ "on_complete_dispose", require_view={}, timeout=10},
"default",
"open_output",
} This disposes all the tasks after 10 seconds. Great, this is the expected behavior. Case 2{
"default",
"open_output",
} This doesn't dispose all the tasks. This is also expected. The reason is that the overseer.nvim/lua/overseer/config.lua Line 152 in d78fa84
Each task has Case 3{
{ "on_complete_dispose", require_view={}, timeout=10},
"default",
} This disposes all the tasks after 10 seconds. This is still expected. By passing in SolutionI think what you are probably looking for is {
-- Because of the default values this is equivalent to
-- { "on_complete_dispose", require_view={} }
"on_complete_dispose",
"default",
"open_output",
} This uses the default 300 second timer, and doesn't require that the output buffers are viewed before they can be disposed. If you are still experiencing unexpected behavior, try increasing the log level and inspecting the logs. That should help you figure out what's going on. You can set the log level using: require("overseer").setup({
log = {
{
type = "echo",
level = vim.log.levels.WARN,
},
{
type = "file",
filename = "overseer.log",
level = vim.log.levels.DEBUG,
},
},
}) |
Closing this for now because I'm not gonna have time to test it for a month or so and I don't want to pollute the bug tracker. I'll re-open in the future if I'm able to provide more detail. |
Neovim version (nvim -v)
0.10.0
Operating system/version
arch linux
Describe the bug
Tasks do not dispose consistently:
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
:luafile ~/.local/share/nvim/lazy/compiler.nvim/tests/tests.lua
. This will spawn ~100 tasks over 1 minute (don't worry if some fail due to not having the required dependency installed).You will see they don't dispose correctly like they used to.
Expected Behavior
All tasks and orchestrators dispose after 300s.
Minimal example file
No response
Minimal init.lua
No response
Additional context
Hopefully I don't have to bother you much more after this one. But it seems to be a bug.
The text was updated successfully, but these errors were encountered: