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

(enh) Change occ background-job:list limit default 10->500 #40042

Conversation

joshtrichards
Copy link
Member

Summary

I'd been wondering for awhile why not all background jobs would show up under occ background-job:list even though all jobs were clearly being executed. Spent an embarrassing amount of time reviewing the code on this... only to realize there was a default limit of 10 in the command. 🤣

I understand why there is a limit (large environments) - and it can be easily overridden - but I feel 10 is bit too conservative for a default. Being this low means the job list is nearly always incomplete in the default execution mode, which makes the overriding of the default nearly a 100% certainty in day to day use.

Nearly all environments >10 and many (most?) <100 jobs. This changes the default to 100 so fewer have to feel as silly as me. 😃 And a lot more people get all their jobs shown by default. At the same time, this higher default still remains conservative enough to avoid problems in really large environments.

TODO

  • ...

Checklist

@szaimen szaimen added this to the Nextcloud 28 milestone Aug 25, 2023
@szaimen szaimen requested review from come-nc, a team, ArtificialOwl and nfebe and removed request for a team August 25, 2023 13:44
@joshtrichards joshtrichards changed the title (enh) Change occ background-job:list limit default 10->100 (enh) Change occ background-job:list limit default 10->100 Aug 25, 2023
@solracsf
Copy link
Member

solracsf commented Aug 25, 2023

Why just dont occ background-job:list -l 100 ? 🤔

-l, --limit[=LIMIT]    Number of jobs to retrieve [default: "10"]

@joshtrichards
Copy link
Member Author

Why just dont occ background-job:list -l 100 ? 🤔

-l, --limit[=LIMIT]    Number of jobs to retrieve [default: "10"]

Yes, the parameter works. I just think 10 is an overly low default. It'll almost never show all the jobs, even in tiny installations. Effectively the operator has to know to always specify a limit if they actually want to see an accurate job list. This nullifies the 10 as a useful default.

It's may seem a nitpick, but it also creates more mental load for what seems no net benefit from what I can tell.

@SystemKeeper
Copy link
Contributor

Maybe it makes sense to add a note to the output like „Showing the first X jobs“, or „Output is limited to X jobs“ to indicate that there’s a limit active.

Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an indication in the output if the list is complete or not would indeed be also good.

@joshtrichards joshtrichards force-pushed the jr-occ-background-job-list-limit-100 branch from 168c57c to 42c976f Compare August 29, 2023 00:52
@joshtrichards
Copy link
Member Author

Done. Though, technically, it breaks json output format...

@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
@mejo- mejo- force-pushed the jr-occ-background-job-list-limit-100 branch 2 times, most recently from 34211c3 to 32bdd7f Compare November 14, 2023 14:54
Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea 👍

core/Command/Background/ListCommand.php Outdated Show resolved Hide resolved
@mejo- mejo- requested a review from kesselb November 14, 2023 14:58
@mejo- mejo- force-pushed the jr-occ-background-job-list-limit-100 branch from 3f527ae to 136a199 Compare November 14, 2023 15:49
The default limit of 10 seems too conservative. Nearly all environments >100 and most <10. At the same time, this higher default limit still remains reasonable to avoid problems in really big environments.

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
mejo- and others added 4 commits November 14, 2023 21:04
Co-authored-by: Daniel <mail@danielkesselberg.de>
Signed-off-by: Jonas <jonas@freesources.org>
* Only print the comment when job list is truncated
* Show the comment at the end so users actually see it
* Format the comment as comment

Signed-off-by: Jonas <jonas@freesources.org>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Jonas <jonas@freesources.org>
@mejo- mejo- force-pushed the jr-occ-background-job-list-limit-100 branch from 7fc0675 to af4287d Compare November 14, 2023 20:04
@blizzz blizzz mentioned this pull request Nov 14, 2023
@mejo- mejo- changed the title (enh) Change occ background-job:list limit default 10->100 (enh) Change occ background-job:list limit default 10->500 Nov 15, 2023
@nickvergessen nickvergessen merged commit ff8d9d2 into nextcloud:master Nov 15, 2023
47 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews feature: occ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants