Story #2659
Updated by bmbouter about 7 years ago
In Pulp3, the Worker model has an 'online' boolean which This is meant to allow Pulp to store records about workers even after they have gone offline. Additionally workers should be considered offline if their heartbeat time is older than 30 seconds. We need to filter for both cases because of the following failure scenario: 1) a working Pulp system with exactly 1 worker Pulp2 issue [0] that has pid 1234 2) kill -9 1234 In this case, was not carried forward in the DB record will show 'online' without the 30 second part of the filter. To resolve this we should: 1) add a method called <code>online_workers</code> merge forward to the "TaskManager":https://github.com/bmbouter/pulp/blob/e5986173d1617fcadb520c84b78691982cce2218/platform/pulpcore/app/models/task.py#L38 which returns a queryset with the two filters applied as described above Pulp3. 2) refactor The PR for the "get_unreserved_worker":https://github.com/bmbouter/pulp/blob/e5986173d1617fcadb520c84b78691982cce2218/platform/pulpcore/app/models/task.py#L40 method Pulp2 fix is at [1] We need to use <code>online_workers</code> instead. This will cause us update get_unreserved_workers [2] to stay DRY w.r.t. this filtering. 3) Have the ViewSet of the /status/ API only return workers from show the <code>online_workers</code> queryset. online workers. [0] https://pulp.plan.io/issues/2496 4) Update the docstrings so that those updates will flow to the docs [1] https://github.com/pulp/pulp/pull/2920 [2] https://github.com/pulp/pulp/blob/3.0-dev/app/pulp/app/models/task.py#L40