oasisprotocol / oasisprotocol/oasis-core

Fix bug causing nodes to terminate prematurely

Open
#6,092 0 comments 0 reactions 1 assignee View on GitHub

@peternose is already working on this.

Since Feb 28, 2025.

  • #6093 by @peternose — open
c:bug
Dominant language
Go
Stars
369
Forks
151
Avg merge
1d 3h
Merged PRs (30d)
6

Description

Sometimes, a node stops immediately after it is started.

Test failure example:

Error: root: failed to run scenario: root: failed to run scenario: oasis: keymanager-0 node terminated: env: sub-process exited early

The problem occurs when a service (e.g., common worker, registry worker, storage worker, etc.) exits prematurely. In such cases, the service manager shuts down all services, even if the exiting service completed its job gracefully.

To address this, we can:

  • Add an Err function to BackgroundService and check for errors before the service manager stops other services.
  • Modify services to never exit, even if they are disabled.
  • Rename te BackgroundService interface to Service and redesign to either:
    • Serve(ctx context.Context) error, or
    • Serve() error along with a separate Shutdown() error.

The third option is the most effective but also the most complex. Changing the interface ensures that services can notify the caller if an error occurs during execution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.