Skip to content

Add ToTryTimeoutSpec: pin what #330 fixes - #421

Open
tobiajo wants to merge 1 commit into
evolution-gaming:m/use-`autoYieldThreshold`-as-limit-for-`syncStep`-callfrom
tobiajo:tj/totry-timeout-spec
Open

tobiajo wants to merge 1 commit into
evolution-gaming:m/use-`autoYieldThreshold`-as-limit-for-`syncStep`-callfrom
tobiajo:tj/totry-timeout-spec

Conversation

@tobiajo

@tobiajo tobiajo commented Aug 31, 2026

Copy link
Copy Markdown

Unit tests for the ioToTry timeout, on top of #330.

On master, ioToTry uses syncStep + unsafeRunTimed. On timeout unsafeRunTimed fire-and-forgets a cancel and returns immediately — it never waits for finalizers, and .uncancelable work keeps running. kafka-flow's TopicFlow.safeguard takes a semaphore permit inside .uncancelable; the poll thread moves on while the abandoned fiber still holds the permit, and every subsequent poll blocks on the semaphore — the consumer silently stops processing.

All three specs fail on master, pass on this branch:

spec master #330
timeout releases a resource acquired before the async boundary
a timed-out attempt does not strand the guard it acquired
an uncancelable guarded recovery completes and releases its guard

To see both directions:

```
git checkout master -- core/src/main/scala/com/evolutiongaming/catshelper/ToTry.scala
sbt "core/testOnly *ToTryTimeoutSpec"
```

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2923d958-82dc-424e-a013-a4a676c7d27b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tobiajo
tobiajo force-pushed the tj/totry-timeout-spec branch 6 times, most recently from 4bcf7fb to 6c4c70b Compare August 31, 2026 10:51
@tobiajo tobiajo changed the title Add ToTryTimeoutSpec: pin what #330 fixes and what it costs Add ToTryTimeoutSpec: pin what #330 fixes Aug 31, 2026
Comment thread core/src/test/scala/com/evolutiongaming/catshelper/ToTryTimeoutSpec.scala Outdated
Comment thread core/src/test/scala/com/evolutiongaming/catshelper/ToTryTimeoutSpec.scala Outdated
Comment thread core/src/test/scala/com/evolutiongaming/catshelper/ToTryTimeoutSpec.scala Outdated
Comment thread core/src/test/scala/com/evolutiongaming/catshelper/ToTryTimeoutSpec.scala Outdated
Comment thread core/src/test/scala/com/evolutiongaming/catshelper/ToTryTimeoutSpec.scala Outdated
Comment thread core/src/test/scala/com/evolutiongaming/catshelper/ToTryTimeoutSpec.scala Outdated
@tobiajo

tobiajo commented Sep 8, 2026

Copy link
Copy Markdown
Author

Redundant if #425 lands.

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.

2 participants