Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: webui

      Description

      Reported by Tomasz Janiszewski

      Hi

      When task has enabled Mesos healthcheck start time in UI can show wrong
      time. This happens because UI assumes that first status is task started
      [0]. This is not always true because Mesos keeps only recent tasks statuses
      [1] so when healthcheck updates tasks status it can override task start
      time displayed in webui.

      Best
      Tomek

      [0]
      https://github.com/apache/mesos/blob/master/src/webui/master/static/js/controllers.js#L140
      [1]
      https://github.com/apache/mesos/blob/f2adc8a95afda943f6a10e771aad64300da19047/src/common/protobuf_utils.cpp#L263-L265

        Activity

        Hide
        janisz Tomasz Janiszewski added a comment - - edited

        I think the right solution is to change condition in void Master::updateTask(Task* task, const StatusUpdate& update) that checks if new status has same state to check if new status has same state, reason and health and only if all this fields are the same drop previous message.

        Show
        janisz Tomasz Janiszewski added a comment - - edited I think the right solution is to change condition in void Master::updateTask(Task* task, const StatusUpdate& update) that checks if new status has same state to check if new status has same state, reason and health and only if all this fields are the same drop previous message.
        Hide
        alexr Alexander Rukletsov added a comment -

        If I understand correctly what you say, there is no way to get task start time from /state endpoint if health check is enabled. If this is true, we should fix this first, then the UI fix will be straightforward.

        Show
        alexr Alexander Rukletsov added a comment - If I understand correctly what you say, there is no way to get task start time from /state endpoint if health check is enabled. If this is true, we should fix this first, then the UI fix will be straightforward.
        Hide
        janisz Tomasz Janiszewski added a comment -

        Exactly. If first status in array will be status when task is running UI will work.

        Show
        janisz Tomasz Janiszewski added a comment - Exactly. If first status in array will be status when task is running UI will work.
        Hide
        haosdent@gmail.com haosdent added a comment -

        As Alexander Rukletsov said, how about add an optional field start_time in message Task and set it in updateTask?

        Show
        haosdent@gmail.com haosdent added a comment - As Alexander Rukletsov said, how about add an optional field start_time in message Task and set it in updateTask ?
        Hide
        alexr Alexander Rukletsov added a comment -

        I didn't say so, but if you mean extending Task message with start_time, I think it makes sense.

        Show
        alexr Alexander Rukletsov added a comment - I didn't say so, but if you mean extending Task message with start_time , I think it makes sense.
        Hide
        janisz Tomasz Janiszewski added a comment -

        Agree, definitely less hacky then assumption first status is start time. I will prepare separated patches for backend and UI.

        Show
        janisz Tomasz Janiszewski added a comment - Agree, definitely less hacky then assumption first status is start time. I will prepare separated patches for backend and UI.
        Hide
        haosdent@gmail.com haosdent added a comment -

        Cool!

        Show
        haosdent@gmail.com haosdent added a comment - Cool!
        Hide
        janisz Tomasz Janiszewski added a comment -

        I created first commit https://github.com/janisz/mesos/commit/0256557e89360bffe902b56ebf7e478cc34e8876#diff-28ebad5255c4c1a70b4abf35651198fdR7825 but I have no idea when start time should be updated? I changed updateStatus and if status is != STAGING and task already has not start time or update is earlier then start time gets updated with status timestamp. Is this good way or maybe it should be handle differently.

        Show
        janisz Tomasz Janiszewski added a comment - I created first commit https://github.com/janisz/mesos/commit/0256557e89360bffe902b56ebf7e478cc34e8876#diff-28ebad5255c4c1a70b4abf35651198fdR7825 but I have no idea when start time should be updated? I changed updateStatus and if status is != STAGING and task already has not start time or update is earlier then start time gets updated with status timestamp. Is this good way or maybe it should be handle differently.
        Hide
        haosdent@gmail.com haosdent added a comment -

        The current behaviour is to set the start time once receive first TaskState https://github.com/apache/mesos/blob/master/src/webui/master/static/js/controllers.js#L140-L160 , should we follow this?

        Show
        haosdent@gmail.com haosdent added a comment - The current behaviour is to set the start time once receive first TaskState https://github.com/apache/mesos/blob/master/src/webui/master/static/js/controllers.js#L140-L160 , should we follow this?
        Hide
        haosdent@gmail.com haosdent added a comment -

        ping Tomasz Janiszewski Do you think is this way acceptable?

        Show
        haosdent@gmail.com haosdent added a comment - ping Tomasz Janiszewski Do you think is this way acceptable?
        Hide
        janisz Tomasz Janiszewski added a comment -

        Yes, I think this could work. Do we have guarantee that TaskState arrives in order, so there won't be a situation when we set start time and then get update with earlier timestamp.

        Show
        janisz Tomasz Janiszewski added a comment - Yes, I think this could work. Do we have guarantee that TaskState arrives in order, so there won't be a situation when we set start time and then get update with earlier timestamp.

          People

          • Assignee:
            janisz Tomasz Janiszewski
            Reporter:
            haosdent@gmail.com haosdent
            Shepherd:
            haosdent
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Development