Story #4283
closedtasks viewsets now require content viewsets/serializers (and significant slowdown)
0%
Description
I'm not exactly sure what's going on here. After someone debugs, please feel free to clean up this issue to make more sense :)
After updating to latest pulpcore and pulpcore-plugin, the tasks/ and tasks/<int>/ endpoints no longer work if one of or more of the tasks are docker sync. This is the error message I saw:
LookupError: Could not determine ViewSet base name for model <class 'pulp_docker.app.models.ManifestList'>
Assuming that the task viewset/serializer had changed, I assumed that the content viewsets/serializers were actually necessary, so I picked up https://pulp.plan.io/issues/3989. However, after an initial implementation of that task, I have seen no difference that seems like it should require a viewset/serializer for the tasks viewset.
(test) ~/d/pulp_docker ❯ http --auth admin:admin http://dev.pulp3:8000/pulp/api/v3/tasks/2/ ⏎
HTTP/1.1 200 OK
Allow: GET, DELETE, HEAD, OPTIONS
Content-Length: 1026
Content-Type: application/json
Date: Thu, 20 Dec 2018 01:36:06 GMT
Server: WSGIServer/0.2 CPython/3.6.7
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"_href": "/pulp/api/v3/tasks/2/",
"created": "2018-12-19T18:15:29.162610Z",
"created_resources": [
"/pulp/api/v3/repositories/3/versions/1/"
],
"error": null,
"finished_at": "2018-12-19T18:16:20.315454Z",
"job_id": "75866cf5-5bed-411e-92b9-17288e57b7be",
"non_fatal_errors": [],
"parent": null,
"progress_reports": [
{
"done": 435,
"message": "Downloading Artifacts",
"state": "completed",
"suffix": "",
"task": "/pulp/api/v3/tasks/2/",
"total": 435
},
{
"done": 720,
"message": "Downloading Artifacts",
"state": "completed",
"suffix": "",
"task": "/pulp/api/v3/tasks/2/",
"total": 720
},
{
"done": 1240,
"message": "Associating Content",
"state": "completed",
"suffix": "",
"task": "/pulp/api/v3/tasks/2/",
"total": 1240
},
{
"done": 0,
"message": "Un-Associating Content",
"state": "completed",
"suffix": "",
"task": "/pulp/api/v3/tasks/2/",
"total": null
},
{
"done": 115,
"message": "Downloading Artifacts",
"state": "completed",
"suffix": "",
"task": "/pulp/api/v3/tasks/2/",
"total": 115
}
],
"spawned_tasks": [],
"started_at": "2018-12-19T18:15:29.245467Z",
"state": "completed",
"worker": "/pulp/api/v3/workers/2/"
}
Additionally, the GET request for a docker sync task is much slower than it used to be, taking ~5 seconds. It used to be nearly instant.
All of this leads me to believe that the tasks `list` and `get` views are doing some slow db queries (joins?) and the information provided by those queries does not appear to be included in the information returned to the user. It may not be a bug at all, but seems like something worth investigation.
Fix bad pause when serializing repository versions
And also tasks by association, via CreatedResource, which apparently serializes the RepositoryVersion also.
closes #4283 https://pulp.plan.io/issues/4283