Comments (7)
It's all yours! Do you feel like you have a good idea on how to start? Feel free to ask questions here or in Discord (in the cats-effect-dev
channel) and we'll be happy to help.
from cats-effect.
@djspiewak
Thank you very much. I'm planning to start by doing some research to understand the content of the issue better. I might ask some basic questions, but I appreciate your support.
from cats-effect.
This is a good idea. We should probably also do it in IO
. unsafeRunTimed
is a bit bizarre because it's the only flavor of cancelation which doesn't backpressure and instead just yolo-disconnects from the computation. We need to keep that semantic (because it is designed to do precisely that), but this doesn't mean we shouldn't at least try to queue up the cancelation.
from cats-effect.
We should probably also do it in
IO
I thought so, but it would be changing the explicitly documented API.
cats-effect/core/jvm/src/main/scala/cats/effect/IOPlatform.scala
Lines 47 to 48 in 328f61d
For the record, I can't think why we wouldn't want to improve it 😅
from cats-effect.
Yeah I'm in favor of improving both.
from cats-effect.
@armanbilge @djspiewak
I'm a beginner, and I think it might take me some time, but I'd like to give it a try.
If it's okay with you, could you please assign the issue to me?
from cats-effect.
@djspiewak
I would like to confirm my understanding of the approach for this issue.
The main content of this issue, as I understand it, is that we want to perform a cancel()
operation when an InterruptedException
is issued in the following places:
DispatcherPlatform#unsafeRunTimed
IOPlatform#unsafeRunTimed
Next, I will express my thoughts on how we should address this in both (1) and (2).
For (1), my thought is that we should handle an InterruptedException
in the same way we do for a TimeoutException
, by performing a cancel()
.
For (2), based on my interpretation of the following comment, #3967 (comment)
I thought the approach might be something like this:
- In the case of a timeout => yolo-disconnected (current implementation)
- In the case of being interrupted =>
cancel()
I'm not sure how to proceed with this, but I would like to confirm if my understanding is correct.
Or perhaps, even in the case of a timeout, is it acceptable to perform a cancel()
instead of just being yolo-disconnected? In this case, I believe using unsafeToFutureCancelable()
like in DispatcherPlatform#unsafeRunTimed
seems to be a viable approach.
from cats-effect.
Related Issues (20)
- sequential dispatcher: race condition in release `step` causes disorder
- Delaying a task to be run far into the future can prevent concurrently scheduled tasks from running HOT 3
- Document stack-safety requirements of typeclasses
- Flakiness in `SchedulerSpec` HOT 1
- Flakiness in `SupervisorSpec` HOT 1
- Dispatcher sequential runs queued tasks concurrently when closing HOT 2
- Flakiness in `IOSpec` HOT 1
- better handling of callbacks that might throw in `CallbackStack` HOT 1
- Allow overriding how fatal errors are printed HOT 7
- Improve `MonadCancel` scaladoc HOT 4
- Cancelling `Async` queue `take` makes other `take` hang HOT 5
- `IO#asyncCheckAttempt` is inconsistent with `Async#asyncCheckAttempt`
- Improve contributor documentation HOT 3
- Add (best-effort) stealing API to polling system
- Add API to polling system to attempt to get current poller without shifting HOT 6
- More efficient monitoring of fibers on virtual threads HOT 1
- Published tutorial older than tutorial.md HOT 1
- OutOfMemoryError when IO.uncancelable is used in recursive function HOT 3
- unsafeToFutureCancelable's cancel future completes before setting the result future's cancellation status HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cats-effect.