typelevel / typelevel/fs2

3.13.0-M8 Stream.pauseWhen changed behavior when using mergeHaltL

Open
#3,655 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
2.5k
Forks
636
Avg merge
2d 4h
Merged PRs (30d)
7

Description

It seems that Stream.pauseWhen changed behavior (stream1 not pausing when pauseSignal is true) on 3.13.0-M8
This code runs ok on 3.13.0-M7 (but not on 3.13.0-M8), stream1 pauses when pauseSignal is true:

stream1
  .pauseWhen(pauseSignal)
  .mergeHaltL(stream2)

On 3.13.0-M8 this code needs to be changed to the following in order to pause stream1:

stream1
  .pauseWhen(pauseSignal)
  .noneTerminate
  .mergeAndAwaitDownstream(stream2.map(Some(_)))
  .unNoneTerminate

Is this the expected behavior since the merge of https://github.com/typelevel/fs2/pull/3610?

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 reproducing the two examples on 3.13.0-M7 and 3.13.0-M8, then compare the mergeHaltL behavior with the changes in PR 3610. Determine whether pauseWhen should still pause stream1 and whether the M8 change is intentional; done means the behavior is clarified and, if it is a regression, covered by an appropriate fix or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.