File tree Expand file tree Collapse file tree
src/main/java/io/jenkins/plugins/pipelinegraphview/livestate Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 * feeds it to the corresponding {@link LiveGraphState}. The downstream {@code PipelineGraphApi}
1414 * path reads a snapshot of that state instead of walking the whole execution each time.
1515 *
16- * <p>We use the async {@link GraphListener} rather than {@code GraphListener.Synchronous}:
17- * HTTP readers poll every few seconds, so we only need eventual consistency, and keeping
18- * the listener off the CPS VM thread avoids any risk of blocking execution. Every code path
19- * is still wrapped in try/catch and poisons the state on failure so a bug here can never
20- * disrupt a build.
16+ * <p>We use {@link GraphListener.Synchronous} rather than the async variant because callers
17+ * expect "once a node is a head, the next API read reflects it" — async delivery creates a
18+ * lag window where the snapshot is behind the execution, which breaks tests that check state
19+ * at precise trigger points and would surprise anyone hitting the REST API after an event.
20+ * The work done under the monitor is trivial ({@code ArrayList}/{@code HashSet} additions),
21+ * so the CPS VM thread is not meaningfully blocked. Every code path is still wrapped in
22+ * try/catch and poisons the state on failure so a bug here can never disrupt a build.
2123 */
2224@ Extension
23- public class LiveGraphPopulator implements GraphListener {
25+ public class LiveGraphPopulator implements GraphListener . Synchronous {
2426
2527 private static final Logger logger = LoggerFactory .getLogger (LiveGraphPopulator .class );
2628
You can’t perform that action at this time.
0 commit comments