typelevel / typelevel/cats-effect

3.5.0 async uncancelable changes are not enforced by laws

Open
#3,725 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:book: laws
Dominant language
Scala
Stars
2.2k
Forks
576
Avg merge
2d 11h
Merged PRs (30d)
18

Description

In 3.5.0 there was a breaking semantic change to async/async_:

As of 3.5.0, the following is now considered to be uncancelable:

IO {
  // ...
  None    // we aren't returning a finalizer
  }
}

Previously, the above was cancelable without any caveats. Notably, this applies to all uses of the async_ constructor!

There are no new laws to ensure this behavior, a build updating to 3.5.1 passes without having to add uncancelability to the implemenation of async.

I think this may be a potential footgun for any third-party implementors of CE typeclasses if the laws don't specify this behavior.

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.

Research direction

Start by locating the laws and implementations covering the async and async_ constructors, then compare them with the 3.5.0 uncancelability semantics described in the issue. Add law coverage that distinguishes callbacks returning no finalizer, and run the relevant law suite; done means third-party async implementations cannot pass without honoring the new behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.