Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-36408

Client-side replay (or store and forward) of SSE events

    Details

    • Epic Link:
    • Sprint:
      1.0-m11, 1.0-m12
    • Similar Issues:

      Description

      Sometimes SSE events can happen too fast for the client to make sense of them because of other incomplete async work relating to earlier events.

      E.g.

      When new branches are added to a multi-branch job, events are fired in the following order:

      1. CRUD create event for the branch job
      2. Job build run queued
      3. Job build run started
      4. etc

      Atm, the above sequence of events happens too fast for the UI. The CRUD create event is still being processed (getting the branch info and updating the redux store) when the build run queued/started events arrive.

      When the build run queued/started events arrive, branch state update redux actions are triggered, but the redux store still knows nothing about the branch and so ignores it, causing the events to effectively be ignored.

      We could rejig the action handlers and store events etc etc, handling things within the redux store, but I think it would be better to try fix this in a generic way if possible because this seems like a scenario that we'll hit again.

      My current thinking is that we could tell an SSE listener instance to stop sending specific events for a period of time and play them later when told.

      So, taking the above multi-branch job .... when we receive the CRUD create event, we tell the listener to stop sending events for that job for now .... we get the job info, update the redux store and then tell the listener to start sending the events again, at which point it would play all of the events that happened during the window where it was not forwarding the events. This way, the events happen in the client in an order in which it can make more sense of them.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: tfennelly
            Path:
            src/test/resources/multibranch/test_results/Jenkinsfile
            http://jenkins-ci.org/commit/blueocean-acceptance-test/5c7a215b970cd299acfce0edeb6b10ff610e6cc9
            Log:
            Add a small wait in the Jenkinsfile used by multibranch/testResults.js

            This is to ensure we don't hit random flaky fails due to JENKINS-36408

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: tfennelly Path: src/test/resources/multibranch/test_results/Jenkinsfile http://jenkins-ci.org/commit/blueocean-acceptance-test/5c7a215b970cd299acfce0edeb6b10ff610e6cc9 Log: Add a small wait in the Jenkinsfile used by multibranch/testResults.js This is to ensure we don't hit random flaky fails due to JENKINS-36408
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tom Fennelly
            Path:
            src/test/resources/multibranch/test_results/Jenkinsfile
            http://jenkins-ci.org/commit/blueocean-acceptance-test/b3b447e3389c4f127fadbd60032799bae073774f
            Log:
            Add a small wait in the Jenkinsfile used by multibranch/testResults.js (#87)

            • Add a small wait in the Jenkinsfile used by multibranch/testResults.js

            This is to ensure we don't hit random flaky fails due to JENKINS-36408

            • A bit more detail in the comment
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tom Fennelly Path: src/test/resources/multibranch/test_results/Jenkinsfile http://jenkins-ci.org/commit/blueocean-acceptance-test/b3b447e3389c4f127fadbd60032799bae073774f Log: Add a small wait in the Jenkinsfile used by multibranch/testResults.js (#87) Add a small wait in the Jenkinsfile used by multibranch/testResults.js This is to ensure we don't hit random flaky fails due to JENKINS-36408 A bit more detail in the comment
            Hide
            michaelneale Michael Neale added a comment -

            Tom FENNELLY do you think this would potentially make things better ( I bet there are a bunch of "edge cases" that could be fixed by this)?

            Show
            michaelneale Michael Neale added a comment - Tom FENNELLY do you think this would potentially make things better ( I bet there are a bunch of "edge cases" that could be fixed by this)?
            Hide
            tfennelly Tom FENNELLY added a comment -

            I can see how I’d want to do this, but the problem I’m having atm is in creating the scenario that demos how it is required. The use case I listed in the description no longer seems to require client-side SAF. I'll keep poking to see can I reproduce the scenario, but if I can't maybe we should just park this for now and come back once we have a hard requirement for it.

            Show
            tfennelly Tom FENNELLY added a comment - I can see how I’d want to do this, but the problem I’m having atm is in creating the scenario that demos how it is required. The use case I listed in the description no longer seems to require client-side SAF. I'll keep poking to see can I reproduce the scenario, but if I can't maybe we should just park this for now and come back once we have a hard requirement for it.
            Hide
            jamesdumay James Dumay added a comment -

            Lets reopen this one when it becomes required.

            Show
            jamesdumay James Dumay added a comment - Lets reopen this one when it becomes required.

              People

              • Assignee:
                tfennelly Tom FENNELLY
                Reporter:
                tfennelly Tom FENNELLY
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: