oasisprotocol / oasisprotocol/oasis-core
Fix bug causing nodes to terminate prematurely
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
Errfunction toBackgroundServiceand check for errors before the service manager stops other services. - Modify services to never exit, even if they are disabled.
- Rename te
BackgroundServiceinterface toServiceand redesign to either:Serve(ctx context.Context) error, orServe() erroralong with a separateShutdown() 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.