Story #3041
Updated by Ichimonji10 almost 7 years ago
Let's say I install the pulp consumer on a host, bind it to an RPM repository, and schedule the installation of a package. If I start GETting <code>/pulp/api/v2/consumers/<consumer_id>/history/?event_type=content_unit_installed</code>, I'll initially get responses like this: <pre><code class="python">[]</code></pre> Eventually, a new event will be listed: <pre><code class="python">[{'_id': {'$oid': '59ca98be14059a396d393282'}, '_ns': 'consumer_history', 'consumer_id': '41223be0-c0a8-4822-9a3d-0b6a81327c37', 'details': {'units': [{'type_id': 'rpm', 'unit_key': {'name': 'dog'}}]}, 'id': '59ca98be14059a396d393282', 'originator': 'SYSTEM', 'timestamp': '2017-09-26T18:13:18Z', 'type': 'content_unit_installed'}] </code></pre> The <code>timestamp</code> in this task exactly matches the time for which this task was scheduled. In other words, this event indicates that a content unit installation has *started*, not that it has *completed*. So, what if I want to track the asynchronous task that's been fired off? How do I do that? It can't be done. No task href is listed in this response. Furthermore, the <code>id</code> listed in this response doesn't apper to correspond to the <code>id</code> listed in any task at all, ever. On the test system on which this task was executed, <code>journalctl | grep 59ca98be14059a396d393282</code> returned no text at all. Furthremore, I think it is *is* possible to track these content unit installation tasks. Here's a line from the system journal: <pre>Sep 26 14:13:18 rhel-7-pulp-2-14 goferd[15597]: [INFO][worker-0] gofer.rmi.dispatcher:603 - call: Content.install() sn=606e2b7d-0178-48c2-afcd-2eedfc0399ad data={'task_id': 'c5740685-7da1-43cc-b0c7-4367133c12e3', 'consumer_id': '41 223be0-c0a8-4822-9a3d-0b6a81327c37'}</pre> Task c5740685-7da1-43cc-b0c7-4367133c12e3 appears to track the installation of this schedule content unit installation. This issue negatively affects QE's ability to test pulp-consumer in an automated manner. For an example of an affected issue, see "Pulp Smash #611":https://github.com/PulpQE/pulp-smash/issues/611.