ceph-salt icon indicating copy to clipboard operation
ceph-salt copied to clipboard

"ceph-salt deploy --non-interactive" does not display progress reliably

Open smithfarm opened this issue 4 years ago • 5 comments

I use "ceph-salt deploy --non-interactive" a lot and I've noticed that it does not display progress messages reliably. Sometimes a message that definitely was supposed to be issued, is not displayed. Other times, a message gets duplicated.

Here is an example of the latter case:

    admin: [2020-02-26 12:20:30.639116] [admin.mini.com  ] [STAGE] [BEGIN] Ceph tools
    admin: [2020-02-26 12:20:30.639116] [admin.mini.com  ] [STAGE] [BEGIN] Ceph tools
    admin: [2020-02-26 12:22:35.684218] [admin.mini.com  ] [STAGE] [END  ] Ceph tools

The "BEGIN" message is duplicated. I've seen messages getting "triplicated" and "quadruplicated" too...

Other times, messages I would expect to see, are not seen. For example, in one run I see:

    admin: [2020-02-26 10:57:27.763910] [admin.mini.com  ] [STAGE] [BEGIN] Ceph tools
    admin: [2020-02-26 10:57:27.776911] [admin.mini.com  ] [STEP ] [BEGIN] Install cephadm and other packages
    admin: [2020-02-26 10:58:40.017343] [admin.mini.com  ] [STEP ] [END  ] Install cephadm and other packages
    admin: [2020-02-26 10:58:40.034019] [admin.mini.com  ] [STEP ] [BEGIN] Download ceph container image

while in another run I see "Ceph tools" step, but "Install cephadm and other packages" and "Download cpeh container image" messages are not seen at all.

I have not yet discerned any patterns in the occurrence of this phenomenon - it seems random.

smithfarm avatar Feb 26 '20 12:02 smithfarm

Does this happen when manually running ceph-salt deploy --non-interactive or via sesdev? sesdev turn off the stdout buffer size when deploying: stdbuf -o0 ceph-salt -ldebug deploy --non-interactive

Not sure if this helps.

bk201 avatar Mar 05 '20 03:03 bk201

Salt does not guarantee that events are delivered by the same order they were fired.

In interactive mode, we update the whole UI when a new Salt event is received, so we will never see duplicates or missing events.

In non-interactive mode, we just print the event when we receive it, so we need to find a clever way of processing events in this mode.

One possible solution is to have some kind of event queue to postpone the print of events that were received out of order.

ricardoasmarques avatar Mar 05 '20 09:03 ricardoasmarques

What about just showing the END messages and omit the BEGIN messages?

sebastian-philipp avatar Mar 12 '20 10:03 sebastian-philipp

What about just showing the END messages and omit the BEGIN messages?

That wouldn't work well - if a step hangs, we would have to enable logging and refer to the log file to figure out which one it is.

smithfarm avatar Mar 12 '20 10:03 smithfarm

If salt events have a "creation timestamp", maybe we can make use of it. I need some further investigation.

ricardoasmarques avatar Mar 12 '20 11:03 ricardoasmarques