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
Please fill out the issue checklist below and provide ALL the requested information.
I reviewed open and closed github issues that may be related to my problem.
I tried updating to the latest version of the CF CLI to see if it fixed my problem.
I attempted to run the command with CF_TRACE=1 to help debug the issue.
I am reporting a bug that others will be able to reproduce.
Describe the bug and the command you saw an issue with
Tasks allow you to run one-off commands on an app. Below is an example workflow in the CLI:
Trigger the task
cf run-task app -c <my-command>
Creating task for app static1 in org org-1 / space space-1 as admin...
Task has been submitted successfully for execution.
OK
task name: b0a3bce1
task id: 1309
OK
Obtain result of task to see if it was it successful or not.
cf tasks static1
...
17 c25fabef SUCCEEDED Wed, 30 Oct 2024 16:42:01 UTC ls
16 c76d2713 SUCCEEDED Wed, 30 Oct 2024 16:42:01 UTC ls
15 556f415b SUCCEEDED Wed, 30 Oct 2024 16:42:00 UTC ls
14 c50052eb SUCCEEDED Wed, 30 Oct 2024 16:42:00 UTC ls
13 9afdc979 SUCCEEDED Wed, 30 Oct 2024 16:41:59 UTC ls
12 9c52c14c SUCCEEDED Wed, 30 Oct 2024 16:41:48 UTC ls
11 70d94489 SUCCEEDED Wed, 30 Oct 2024 16:41:47 UTC ls
10 4e24e204 SUCCEEDED Wed, 30 Oct 2024 16:41:46 UTC ls
9 afd1c3cc SUCCEEDED Wed, 30 Oct 2024 16:41:46 UTC ls
8 2344f470 SUCCEEDED Wed, 30 Oct 2024 16:41:45 UTC ls
7 e6e83064 SUCCEEDED Wed, 30 Oct 2024 16:41:45 UTC ls
6 fdd65417 SUCCEEDED Wed, 30 Oct 2024 16:41:44 UTC ls
5 78af57a5 SUCCEEDED Wed, 30 Oct 2024 16:41:43 UTC ls
4 9ea642a8 SUCCEEDED Wed, 30 Oct 2024 16:41:43 UTC ls
3 e21a1c61 SUCCEEDED Wed, 30 Oct 2024 16:41:42 UTC ls
2 b94fe1ee SUCCEEDED Wed, 30 Oct 2024 16:41:35 UTC ls
1 7788d026 SUCCEEDED Wed, 30 Oct 2024 16:41:08 UTC ls
What happened
Behind the scenes the cf cli fetches all tasks for an app. It does this without specifying the page size, so uses the default CAPI page size which is 50. See actor and api client. The result of this is that the CLI may make hundreds of calls. This causes lots of pressure on the CC API and causes the cf tasks <app> command to appear as though its hanging while its making all of these requests. When it eventually completes it will display all of results to the user making the command not very helpful once you get beyond ~50 or so results.
Cloud Controller does prune completed tasks every 31 days by default. However, even with this it is not unusual for periodic tasks to run and there to be thousands of tasks per app on large CF installations.
Expected behavior
cf tasks should not get all tasks by default
Theres a few things we could do here, in no particular order.
Increase the page size of cf tasks to make fewer requests.
Make cf tasks <app> return a sensible human readable number of results (e.g. 50) and introduce a --all flag for users who really want to see everything.
Allow more flags to cf tasks <app> to return a sensible human readable number of results. For example --recent or --limit=50 so that it can be more efficient.
Add a new cf get-task <id> command so that you can look up the result of an individual task rather than having to list all of them.
Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:
Run cf run-task app -c <my-command> 1000 times.
Run cf tasks app -v
See pagination results, slowness and large result set.
The text was updated successfully, but these errors were encountered:
Please fill out the issue checklist below and provide ALL the requested information.
CF_TRACE=1
to help debug the issue.Describe the bug and the command you saw an issue with
Tasks allow you to run one-off commands on an app. Below is an example workflow in the CLI:
What happened
Behind the scenes the cf cli fetches all tasks for an app. It does this without specifying the page size, so uses the default CAPI page size which is 50. See actor and api client. The result of this is that the CLI may make hundreds of calls. This causes lots of pressure on the CC API and causes the
cf tasks <app>
command to appear as though its hanging while its making all of these requests. When it eventually completes it will display all of results to the user making the command not very helpful once you get beyond ~50 or so results.Cloud Controller does prune completed tasks every 31 days by default. However, even with this it is not unusual for periodic tasks to run and there to be thousands of tasks per app on large CF installations.
Expected behavior
cf tasks should not get all tasks by default
Theres a few things we could do here, in no particular order.
cf tasks
to make fewer requests.cf tasks <app>
return a sensible human readable number of results (e.g. 50) and introduce a--all
flag for users who really want to see everything.cf tasks <app>
to return a sensible human readable number of results. For example--recent
or--limit=50
so that it can be more efficient.cf get-task <id>
command so that you can look up the result of an individual task rather than having to list all of them.Exact Steps To Reproduce
Steps to reproduce the behavior; include the exact CLI commands and verbose output:
cf run-task app -c <my-command>
1000 times.cf tasks app -v
The text was updated successfully, but these errors were encountered: