Skip to content

fix(projectController): reconnect SSH before running deferred cleanups on manual clean (aicshud/WHEEL#1023) - #141

Merged
so5 merged 2 commits into
RIKEN-RCCS:mainfrom
so5:fix/issue-1023-onCleanProject-ssh-reconnect
Sep 16, 2026
Merged

so5 merged 2 commits into
RIKEN-RCCS:mainfrom
so5:fix/issue-1023-onCleanProject-ssh-reconnect

Conversation

@so5

@so5 so5 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes aicshud/WHEEL#1023: when a project with a pending deferred remote-file cleanup (left behind by stopProject(), see aicshud/WHEEL#1020/#1021, merged in #140) is cleaned instead of resumed, the preserved remote files were permanently leaked, since onCleanProject() never called runDeferredCleanups() and, even if it had, the SSH connection needed to run it was already disconnected by stopProject().

What changed

  • transferrer.js: added getDeferredCleanupRemotehostIDs(), a non-mutating peek at which remotehosts a project still has pending deferred cleanups for.
  • handlers/projectController.js: added reconnectAndRunDeferredCleanups(), called from onCleanProject() before cleanProject()'s git reset. For each pending remotehost it resolves the connection info the same way runDispatcher() does, reconnects via createSsh() (which may prompt for a password/passphrase - acceptable since cleanProject is only ever triggered by an explicit user action), runs the deferred cleanups, then disconnects again.

Testing

Related

Filed against aicshud/WHEEL#1023 on GitLab (issue tracker for this project). Builds directly on aicshud/WHEEL#1020/#1021/#1022 (merged in #140).

🤖 Generated with Claude Code

https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu

so5 and others added 2 commits September 16, 2026 20:25
onCleanProject() must reconnect SSH for any remotehost with a pending
deferred cleanup (left behind by stopProject(), aicshud/WHEEL#1020/#1021)
before it can call runDeferredCleanups() - the SSH connection was already
unconditionally torn down by stopProject().

- transferrer.js: getDeferredCleanupRemotehostIDs() does not exist yet.
- handlers/projectController.js: onCleanProject() does not attempt any
  SSH reconnection, so a pending deferred cleanup is silently dropped
  once the project is cleaned instead of resumed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu
…s on manual clean (aicshud/WHEEL#1023)

stopProject() (aicshud/WHEEL#1020/#1021) unconditionally disconnects
every SSH connection on stop, but deliberately leaves
deferredCleanupRegistry populated: a not-yet-executed downstream task
may still need the preserved remote-symlink target file if the project
is resumed. If the user cleans the project instead of resuming it,
that entry never gets a chance to run naturally - only runProject()'s
own natural-completion path calls runDeferredCleanups() - permanently
leaking the preserved remote files.

- transferrer.js: add getDeferredCleanupRemotehostIDs(), a non-mutating
  peek at which remotehosts a project still has pending deferred
  cleanups for.
- handlers/projectController.js: add reconnectAndRunDeferredCleanups(),
  called from onCleanProject() before cleanProject()'s git reset. It
  resolves each pending remotehostID's connection info the same way
  runDispatcher() does, reconnects via createSsh() (which may prompt
  for a password/passphrase - acceptable here since cleanProject is
  only ever triggered by an explicit user action), runs the deferred
  cleanups, then disconnects again.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu
@so5
so5 merged commit 1de2e76 into RIKEN-RCCS:main Sep 16, 2026
@so5
so5 deleted the fix/issue-1023-onCleanProject-ssh-reconnect branch September 16, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant