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

Reset specific group #482

Closed
amiroslaw opened this issue Dec 5, 2023 · 3 comments · Fixed by #550
Closed

Reset specific group #482

amiroslaw opened this issue Dec 5, 2023 · 3 comments · Fixed by #550
Labels
s: Client This issue touches the pueue client s: Daemon This issue touches pueue daemon t: Feature A new feature that needs implementation

Comments

@amiroslaw
Copy link

A detailed description of the feature you would like to see added.

I was surprised that I can't reset or remove all tasks from a specific group. I'm not sure if it wasn't implemented in this issue, but there is no parameter --group in the reset option.
I use pueue 3.3.2

Explain your usecase of the requested feature

I want to clean up jobs in a group with one command. It would be nice to have pueue reset --group or pueue remove --group

Alternatives

No response

Additional context

No response

@Nukesor
Copy link
Owner

Nukesor commented Dec 5, 2023

This is due to the fact that pueue reset is a very old feature and actually resets all tasks.
Groups were added years later and until now nobody requested such a feature.

In general, I think this could be a nice quality of life feature. I'm not sure how to implement it yet though. As noted before, the current reset functionality is global, which includes a global lock of all state to prevent tasks from being spawned while resetting the state. The reset operation might take a little while, since tasks need to be stopped and cleaned up, which isn't an instant operation.

For this to work on a group-level, we would have to lock by groups and cover edge-cases such as "What happens if a full reset is triggered while a group reset is running" and vice versa. This needs to be properly designed. Maybe we need to refactor the current global logic as well (maybe we could make the global reset use group resets under the hood).

I'll eventually take a look at this, but I'm currently moving and I'll have to renovate my old + new home. I'll probably not get to implement this in the next few months 😅.

@Nukesor
Copy link
Owner

Nukesor commented Dec 5, 2023

For the time being, there's pueue clean -g, but this obviously only cleans up finished tasks.

@Nukesor Nukesor added t: Feature A new feature that needs implementation s: Daemon This issue touches pueue daemon s: Client This issue touches the pueue client labels Dec 5, 2023
@Nukesor
Copy link
Owner

Nukesor commented Jun 23, 2024

With #547 landing, this change should now become significantly easier.
The whole process handling logic has been streamlined a lot.

PRs welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: Client This issue touches the pueue client s: Daemon This issue touches pueue daemon t: Feature A new feature that needs implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants