Skip to content

SessionOpener.sendPing does not call onCompleted when retry limit is exhausted #17143

Closed

Description

@kevinushey

Summary

In SessionOpener.sendPing(), when the ping loop exhausts its maxRetries without successfully reaching the session, it logs a warning and returns false to stop the RepeatingCommand — but never calls the onCompleted callback.

// SessionOpener.java:216-219
if (retries_++ > maxRetries)
{
   Debug.logWarning("Error connecting with session.");
   return false;  // onCompleted never called
}

Impact

This means ApplicationQuit.onSuspendAndRestartImpl()'s onRestartComplete operation is never executed, so:

  1. suspendingAndRestarting_ stays true permanently, suppressing nested restart detection.
  2. RestartStatusEvent.RESTART_COMPLETED is never fired, leaving any listeners (e.g. Application.resumeClientStateUpdater(), RemoteServer.restartInProgress_) in stale state.
  3. The progress indicator is never dismissed.

Suggested Fix

Call onCompleted before returning false on retry exhaustion:

if (retries_++ > maxRetries)
{
   Debug.logWarning("Error connecting with session.");
   onCompleted.execute();
   return false;
}

Context

Discovered during review of #17141. In practice this is unlikely to trigger because the ping loop targets a restarting local session, but it represents a gap in the completion contract that could cause hard-to-diagnose state issues.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions