Skip to content

Commit 0b310a9

Browse files
committed
Change to async
1 parent b6dd84e commit 0b310a9

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/main/java/io/jenkins/plugins/pipelinegraphview/livestate/LiveGraphPopulator.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
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>This is the {@link GraphListener.Synchronous} variant because we need to observe each
17-
* node before the HTTP layer can query for it. The listener runs on the CPS VM thread and
18-
* must not block — all work here is non-blocking and every code path is guarded against
19-
* exceptions (a thrown exception would kill the build).
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.
2021
*/
2122
@Extension
22-
public class LiveGraphPopulator implements GraphListener.Synchronous {
23+
public class LiveGraphPopulator implements GraphListener {
2324

2425
private static final Logger logger = LoggerFactory.getLogger(LiveGraphPopulator.class);
2526

0 commit comments

Comments
 (0)