awx icon indicating copy to clipboard operation
awx copied to clipboard

UI should poll job endpoint to determine exactly when events are done processing

Open mabashian opened this issue 2 years ago • 3 comments

Peeling this off of https://github.com/ansible/awx/issues/12103

After some discussion, this feels like the best path forward in the short term. Longer term it would be ideal if the UI got an event via the websocket that indicates that we're done processing events but this requires more discussion.

The work here should include triggering a series of GET requests to the job endpoint looking at the event_processing_finished field. One idea to avoid dos'ing the backend would be to iteratively increase the interval that we poll this endpoint. Maybe start out doing it every few seconds and then extend it out to every 30 seconds after some number of iterations.

mabashian avatar Jul 19 '22 15:07 mabashian

as I’ve been thinking about it, we may just want to change the strategy. It really only refreshes job events in case the websocket events skipped some (and to enable expand/collapse if relevant) (edited)

so we probably only need to poll for a minute or two, and if it doesn’t finish processing, just leave the UI as is… After a long delay, I don’t think the user will want to see output disappear and then reload into the screen “randomly”

it might even be worth simply displaying a message instead. “AWX has finished processing events for this job. Click here to refresh”

keithjgrant avatar Jul 19 '22 16:07 keithjgrant

see also #12556 — if we re-think the way we refresh events at job completion, we can probably knock out both these issues together

keithjgrant avatar Jul 20 '22 23:07 keithjgrant

@keithjgrant wondering if https://github.com/ansible/awx/pull/12555 addresses this issue as well. I don't see this issue listed in the PR but they seem sorta kinda related.

mabashian avatar Aug 04 '22 17:08 mabashian

Resolved by https://github.com/ansible/awx/pull/12689

InnocentK avatar Aug 31 '22 20:08 InnocentK