Skip to content

Fix switchToLatest cancellation hangs - #55

Open
pablobaldez wants to merge 2 commits into
sideeffect-io:mainfrom
pablobaldez:pblbaldez-pro-507-fix-asyncextensions-switchtolatest-cancellation-hangs
Open

Fix switchToLatest cancellation hangs#55
pablobaldez wants to merge 2 commits into
sideeffect-io:mainfrom
pablobaldez:pblbaldez-pro-507-fix-asyncextensions-switchtolatest-cancellation-hangs

Conversation

@pablobaldez

Copy link
Copy Markdown

Summary

  • finish switchToLatest() iteration when its consumer is cancelled while the outer or latest inner sequence remains open
  • persist cancellation in the protected iterator state, resume a waiting outer continuation, and prevent replacement child tasks after cancellation
  • add regression coverage for an unfinished latest sequence and a non-cooperative outer sequence

Closes #53

Testing

  • swift test --filter AsyncSwitchToLatestSequenceTests
  • swift test (134 tests)

Persist iterator cancellation and atomically resume a waiting outer continuation so no replacement child task can outlive a cancelled consumer.\n\nAdd regressions for unfinished latest and non-cooperative outer sequences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] switchToLatest collection can hang after cancellation

1 participant