Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1099668 - Need to determine Applicability API completion based on status field vs finished_time
Summary: Need to determine Applicability API completion based on status field vs finis...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Justin Sherrill
QA Contact: Katello QA List
URL:
Whiteboard:
: 1102848 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-20 22:51 UTC by Mike McCune
Modified: 2019-09-26 13:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-02 14:07:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mike McCune 2014-05-20 22:51:34 UTC
There are times when there may not be a "finished_time" field set on the return results of an API call to pulp's applicability API. 

This results in Katello's CV publish being stuck in the 'pending' state and is not the best way to determine if an API call is finished or not.

The better way is to use the status field of the API call and poll that to see if a task/call is complete.

IRC convo for context:

<jsherrill> mmccune: suspended is commong for remote tasks (like pulp tasks) when the task is sleeping waiting for it to finish in pulp
<jsherrill>   finish_time: 
<jsherrill> there's no finish_time!
<jsherrill> that's how we figure out if a task if actually finished or not
<mmccune> ahh
<jsherrill> rbarlow: applicability generation question ^
<jsherrill> why is finish_time blank on applicability_generatin ?
<jsherrill> generation*
<jsherrill> is that expected?
<rbarlow> hmmm, that isn't expected to me
<rbarlow> though, i would suggest against using finish_time to know if a task is finished
<rbarlow> i would recommend making a set of "final states" and checking to see if state is in that set
<rbarlow> things like failed, canceled, finished
<rbarlow> that mgiht be all of them
<jsherrill> rbarlow: yeha i'm not sure why we do
<rbarlow> actually i know a weird thing i did that might make finish time not always be present - if you cancel a task, it most often won't get a finish_time, but it will get one if its a sync or a publish
<rbarlow> it's implementation details
<mmccune> in this case, i didnt cancel
<rbarlow> and i was hoping to find time to fix that, but it didn't seem as important as other problems we've got right now ☺
<rbarlow> yeah i was just mentioning it so you knew that finish_time was a "best effort" and not a guarantee
<rbarlow> i would like to fix that
<rbarlow> but in the meantime, i'd suggest that it's probably better to use the task state anyway - that's what it's for
<jsherrill> rbarlow: yeah, mmccune mind filing an issue for that?
<mmccune> on it
<jsherrill> thanks

Comment 1 Mike McCune 2014-05-20 22:57:58 UTC
results in 'pending' publishes:

155: Actions::Pulp::Repository::RegenerateApplicability (suspended) [ 223.98s / 2.22s ]

Started at: 2014-05-20 18:37:03 -0400

Ended at: 2014-05-20 18:40:46 -0400

Real time: 223.98s

Execution time (excluding suspended state): 2.22s

Input:

---
pulp_id: ACME_Corporation-Library-view3-discover1-repo-4
remote_user: admin

Output:

---
pulp_task:
  exception: 
  task_type: pulp.server.managers.consumer.applicability.regenerate_applicability_for_repos
  _href: /pulp/api/v2/tasks/ec36c84c-415d-43ec-a89e-203d1738b822/
  task_id: ec36c84c-415d-43ec-a89e-203d1738b822
  tags:
  - pulp:action:content_applicability_regeneration
  finish_time: 
  _ns: task_status
  start_time: '2014-05-20T22:37:03Z'
  traceback: 
  spawned_tasks: []
  progress_report: {}
  queue: reserved_resource_worker-1.eng.rdu2.redhat.com.dq
  state: finished
  result: 
  error: 
  _id:
    $oid: 537bd90fb489ace3ab7a7053
  id: 537bd90f018de51a9b616e07
poll_attempts:
  total: 35
  failed: 0

Comment 3 Justin Sherrill 2014-05-20 23:47:35 UTC
Not just applicability but all pulp async tasks should be treated this way.

Comment 4 Eric Helms 2014-05-29 18:20:29 UTC
*** Bug 1102848 has been marked as a duplicate of this bug. ***

Comment 5 Justin Sherrill 2014-05-30 15:27:54 UTC
http://projects.theforeman.org/issues/5960

Comment 6 Justin Sherrill 2014-05-30 15:28:15 UTC
https://github.com/Katello/katello/pull/4161

Comment 8 Corey Welton 2014-06-26 20:22:32 UTC
Marking this verified.  This is mostly a dev task and there's not a real convenient way to test this per say, other than watching to assure tasks don't hang.

I am not seeing tasks hang anymore, so I will mark this as verified. 

Verified in Satellite-6.0.3-RHEL-6-20140626.0

Comment 9 Bryan Kearney 2014-07-02 14:07:41 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.


Note You need to log in before you can comment on or make changes to this bug.