ethereum / ethereum/async-service

Should `ManagerAPI.cancel()` raise an error if the service is already stopping or finished

Open
#35 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10
Forks
11
PR merge metrics
No merged PRs in 30d

Description

from: https://github.com/ethereum/async-service/pull/31#discussion_r359818352

What is wrong

Currently, #31 introduces the rule that if a service is already stopping or finished that calling ManagerAPI.cancel() will return early without doing anything.

Should this instead raise a LifecycleError?

The counter argument to this would be a case where we want to be able to blindly call manager.cancel(). If we choose to raise an exception then the call site would have to do this conditionally which adds boilerplate.

The argument for this is that removes the ambiguity where ManagerAPI.is_cancelled will not always be True after a call to Manager.cancel().

How can it be fixed

Decide which of the above is more important.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Review PR #31 and its discussion, then inspect the ManagerAPI.cancel(), ManagerAPI.is_cancelled, and LifecycleError entry points. Decide whether cancellation after stopping or finishing should be a no-op or raise; done means the chosen behavior is explicit and consistently reflected in the lifecycle handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.