Skip to content

Fixes #8327: Keep ServerPushSession active in Hop Web so logging refresh does not stall - #8344

Merged
mattcasters merged 1 commit into
apache:mainfrom
abhiramaab:fix-8327-hopweb-logging-refresh
Sep 13, 2026
Merged

mattcasters merged 1 commit into
apache:mainfrom
abhiramaab:fix-8327-hopweb-logging-refresh

Conversation

@abhiramaab

Copy link
Copy Markdown
Contributor

Fixes #8327

Problem

In Hop Web (running via Eclipse RAP in the browser), background UI updates triggered via Display.asyncExec(...) (such as log lines from HopGuiLogBrowser's 1-second refresh timer) are buffered on the server and never delivered to the client browser unless an active ServerPushSession is running.

Previously:

  • In HopGuiPipelineGraph and HopGuiWorkflowGraph, ServerPushSessionFacade.stop() was invoked prematurely immediately after kicking off the execution delegate, terminating server push while execution was actively running in the background.
  • If background notifications were disabled, no server push session was running at all during the web session.
  • As a result, the logging tab in the Results panel stalled and did not refresh until the user clicked, typed, or resized the browser window to trigger a client request.

Solution

  1. In HopWebEntryPoint, invoke ServerPushSessionFacade.start() upon session startup so server push remains active throughout the Hop Web user session. Clean shutdown is already handled during session destruction (beforeDestroy).
  2. Remove premature ServerPushSessionFacade.stop() calls from HopGuiPipelineGraph and HopGuiWorkflowGraph.

Copilot AI lite review requested due to automatic review settings September 12, 2026 16:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mattcasters
mattcasters self-requested a review September 12, 2026 20:36

@mattcasters mattcasters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary & Root Cause Analysis

In Hop Web (running Eclipse RAP in the browser), background UI updates triggered via Display.asyncExec(...) (or syncExec(...)) are held on the server and are only pushed to the browser client when a ServerPushSession is actively running. Without an active push session, updates are buffered until the user performs an explicit UI interaction (click, keystroke, window resize) that initiates a client request/response cycle.

Prior to this PR:

  1. Mislocated & Premature Teardown: In HopGuiPipelineGraph.java and HopGuiWorkflowGraph.java, ServerPushSessionFacade.start() was invoked, and immediately after calling executePipeline(...) / executeWorkflow(...), ServerPushSessionFacade.stop() was called.
    • executePipeline() and executeWorkflow() only launch execution asynchronously in background threads and return immediately.
    • Calling stop() right away tore down the server push channel while the pipeline/workflow was actively running.
    • In HopGuiPipelineGraph, stop() was only called if pipelineMeta.isShowDialog() was false, leaving the push state inconsistent depending on how the pipeline was launched.
  2. Singleton Session Scope: In rap, ServerPushSessionFacadeImpl uses SingletonUtil.getSessionInstance(ServerPushSession.class). Stopping it anywhere deactivates push for the entire web session.
  3. Impact: Background timers and listeners—specifically HopGuiLogBrowser's 1-second refresh timer, execution status icon redraws, and metrics table refreshers—stalled in Hop Web until the user manually interacted with the UI (Issue #8327).

Detailed Review of Changes

1. HopWebEntryPoint.java

  • Change:
    Starts server push in createContents():
    ServerPushSessionFacade.start();
    and updates the log message in beforeDestroy():
    LogChannel.UI.logError(
        "Error stopping notifications and server push on session end", e);
  • Evaluation:
    • Correct Lifecycle: Hop Web is an interactive IDE in the browser with continuous background updates throughout a user session (log streaming, transform/action status badges, execution metrics, and notification polling). Tying ServerPushSession to the user's UISession lifecycle (createContents -> beforeDestroy) is the standard and correct Eclipse RAP pattern.
    • Resource Management: RAP manages server push via one standing push request (long-poll/WebSocket) per active client session. When the browser tab is closed or the session expires, beforeDestroy() cleans it up alongside notification services and VFS namespaces.

2. HopGuiPipelineGraph.java & HopGuiWorkflowGraph.java

  • Change:
    • Removed ServerPushSessionFacade.start() and stop() from HopGuiPipelineGraph.start().
    • Removed ServerPushSessionFacade.start() and stop() from HopGuiWorkflowGraph.start() and startWorkflowHere().
    • Removed unused imports of ServerPushSessionFacade.
  • Evaluation:
    • Clean and complete removal. Eliminates the false assumption that execution was synchronous with executePipeline(...)/executeWorkflow(...).
    • Zero regression risk on desktop Hop (RCP), where ServerPushSessionFacadeImpl is a no-op dummy.

Minor Observation (Non-blocking)

  • Redundant call in NotificationSystemInitializer.java:114:
    • NotificationSystemInitializer still calls ServerPushSessionFacade.start();.
    • Because ServerPushSession.start() on the same instance is idempotent in Eclipse RAP ("If the session is already running, this method does nothing"), leaving it here causes no harm.
    • Since HopWebEntryPoint now unconditionally starts server push for the entire Hop Web session, this call is redundant and could either be left as defensive redundancy or cleaned up later.

Conclusion

This PR is surgically focused, well-documented, and accurately resolves the stalled logging and background UI refresh problem in Hop Web. LGTM!

@mattcasters
mattcasters merged commit 61462da into apache:main Sep 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Logging refresh stalls on Hop Web

3 participants