awx
awx copied to clipboard
UI should poll job endpoint to determine exactly when events are done processing
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.
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”
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 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.
Resolved by https://github.com/ansible/awx/pull/12689