feat(remote-comms): Add Node.js e2e tests and fix shutdown handling#692
Merged
feat(remote-comms): Add Node.js e2e tests and fix shutdown handling#692
Conversation
…shutdown handling
FUDCo
approved these changes
Nov 4, 2025
Contributor
FUDCo
left a comment
There was a problem hiding this comment.
LGTM. This looks like it potentially might address one of the things I'm trying to puzzle out!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive end-to-end tests for remote kernel communications in Node.js and addresses critical shutdown issues discovered during testing.
Changes
Testing Infrastructure:
Remote Communications Fixes:
libp2p.stop()issue by switching to connection abort strategy instead of full stopstopRemoteComms()safe to call when remote comms not initialized (returns early instead of throwing)Database Management:
close()method toKernelDatabaseinterface for proper resource cleanup:memory:) to avoid file locking issuesKernel Shutdown:
Technical Details
The main issue addressed was that
libp2p.stop()could hang indefinitely, preventing clean kernel shutdown. The solution involves:libp2p.stop()Testing
Note
Adds Node.js e2e remote-comms tests, shifts libp2p shutdown to connection aborts, makes stopRemoteComms safe if uninitialized, refactors kernel stop order, and introduces KernelDatabase.close().
ConnectionFactory.stop()now aborts all connections (nolibp2p.stop()), clears inflight dials, and logs hangups; tests updated accordingly.stop()reordered: wait for queue → end command stream → stop remote comms via platform services → terminate workers.stopRemoteCommsreturns early if not initialized; related tests updated.packages/cli/src/relay.ts: disable default reservation limits and reducehopTimeout; removed unused protocol handler; added connection/discovery logging.test/vats/remote-vat.jsandtest/make-test-kernel.ts.close()toKernelDatabase; implement in SQLite (Node/WASM) and add tests.@endo/eventual-send,@endo/marshal,@libp2p/interface); adjust coverage thresholds.Written by Cursor Bugbot for commit 400678c. This will update automatically on new commits. Configure here.